修改bug
This commit is contained in:
parent
9b8e002755
commit
a838aca210
@ -142,6 +142,7 @@
|
|||||||
<div>{{ scope.row.difficulty && levelArr[scope.row.difficulty - 1].name }}</div>
|
<div>{{ scope.row.difficulty && levelArr[scope.row.difficulty - 1].name }}</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column prop="score" align="center" width="80px" label="分数"></el-table-column>
|
||||||
<el-table-column prop="options" align="center" width="80px" label="试题答案"></el-table-column>
|
<el-table-column prop="options" align="center" width="80px" label="试题答案"></el-table-column>
|
||||||
<el-table-column prop="createTime" align="center" width="170px" label="创建时间"></el-table-column>
|
<el-table-column prop="createTime" align="center" width="170px" label="创建时间"></el-table-column>
|
||||||
<el-table-column prop="isEnable" align="center" width="100px" label="状态">
|
<el-table-column prop="isEnable" align="center" width="100px" label="状态">
|
||||||
@ -252,6 +253,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column align="center" prop="score" label="分数" width="100"></el-table-column>
|
||||||
<el-table-column align="center" prop="options" label="答案"></el-table-column>
|
<el-table-column align="center" prop="options" label="答案"></el-table-column>
|
||||||
|
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -807,7 +809,7 @@ export default {
|
|||||||
this.personType = 1
|
this.personType = 1
|
||||||
this.title = "编辑考试";
|
this.title = "编辑考试";
|
||||||
// console.log(row);
|
// console.log(row);
|
||||||
this.examForm = row
|
this.examForm = JSON.parse(JSON.stringify(row))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -75,15 +75,18 @@
|
|||||||
<div class="dialogContainer">
|
<div class="dialogContainer">
|
||||||
<div class="dialogLeft">
|
<div class="dialogLeft">
|
||||||
<el-form :model="addCourseForm" ref="addCourseForm" label-width="100px" class="demo-addCourseForm">
|
<el-form :model="addCourseForm" ref="addCourseForm" label-width="100px" class="demo-addCourseForm">
|
||||||
<el-form-item label="科目类型" prop="subjectId" required>
|
<el-form-item label="科目类型" prop="subjectId"
|
||||||
|
:rules="[{required:true,message:'必填',trigger:'change'}]">
|
||||||
<el-select v-model="addCourseForm.subjectId" placeholder="请选择">
|
<el-select v-model="addCourseForm.subjectId" placeholder="请选择">
|
||||||
<el-option :label="item.name" :value="item.id" v-for="(item,i) in examSubjectList" :key="i"></el-option>
|
<el-option :label="item.name" :value="item.id" v-for="(item,i) in examSubjectList" :key="i"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="课程名称" prop="courseName" required>
|
<el-form-item label="课程名称" prop="courseName"
|
||||||
|
:rules="[{required:true,message:'必填',trigger:'change'}]">
|
||||||
<el-input v-model="addCourseForm.courseName"></el-input>
|
<el-input v-model="addCourseForm.courseName"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="课程视频" prop="fileUrl" required>
|
<el-form-item label="课程视频" prop="fileUrl"
|
||||||
|
:rules="[{required:true,message:' ',trigger:['blur','change']}]">
|
||||||
<div>单个文件不超过100M,最多可上传1个附件</div>
|
<div>单个文件不超过100M,最多可上传1个附件</div>
|
||||||
<el-upload class="upload-demo" drag multiple name="files" :limit="1" :action="$store.state.UPLOADURL"
|
<el-upload class="upload-demo" drag multiple name="files" :limit="1" :action="$store.state.UPLOADURL"
|
||||||
accept=".mp4"
|
accept=".mp4"
|
||||||
@ -96,7 +99,8 @@
|
|||||||
<div class="el-upload__text"><i style="font-size: 18px;" class="el-icon-upload"></i>将文件拖到此处,或<em>点击上传</em></div>
|
<div class="el-upload__text"><i style="font-size: 18px;" class="el-icon-upload"></i>将文件拖到此处,或<em>点击上传</em></div>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="课程封面" prop="coverImg" required>
|
<el-form-item label="课程封面" prop="coverImg"
|
||||||
|
:rules="[{required:true,message:' ',trigger:['blur','change']}]">
|
||||||
<el-upload :action="$store.state.UPLOADURL" list-type="picture-card" name="files" :limit="1"
|
<el-upload :action="$store.state.UPLOADURL" list-type="picture-card" name="files" :limit="1"
|
||||||
:on-remove="(file, fileList) => coverHandleRemove(file, fileList)"
|
:on-remove="(file, fileList) => coverHandleRemove(file, fileList)"
|
||||||
:on-success="(res, file) => coverHandleSuccess(res, file)"
|
:on-success="(res, file) => coverHandleSuccess(res, file)"
|
||||||
@ -163,7 +167,13 @@ export default {
|
|||||||
materialFileList: [], // 学习资料文件
|
materialFileList: [], // 学习资料文件
|
||||||
coverFileList: [], // 课程封面文件
|
coverFileList: [], // 课程封面文件
|
||||||
|
|
||||||
addCourseForm: {}, // 新增课程表单
|
addCourseForm: {
|
||||||
|
subjectId:'',
|
||||||
|
courseName:'',
|
||||||
|
fileUrl:'',
|
||||||
|
coverImg:'',
|
||||||
|
remark:''
|
||||||
|
}, // 新增课程表单
|
||||||
studyCycle: [], // 表单日期时间范围
|
studyCycle: [], // 表单日期时间范围
|
||||||
personType: 1, // 人员类型
|
personType: 1, // 人员类型
|
||||||
|
|
||||||
@ -201,6 +211,14 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted() {},
|
mounted() {},
|
||||||
watch:{
|
watch:{
|
||||||
|
dialogVisible(newV,oldV){
|
||||||
|
if(newV === false){
|
||||||
|
this.$refs.addCourseForm.resetFields()
|
||||||
|
}
|
||||||
|
if(this.title === '新增课程'){
|
||||||
|
this.$refs.addCourseForm.resetFields()
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//关闭视频
|
//关闭视频
|
||||||
@ -278,7 +296,20 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
resetForm(){
|
||||||
|
this.addCourseForm = {
|
||||||
|
subjectId:'',
|
||||||
|
courseName:'',
|
||||||
|
fileUrl:'',
|
||||||
|
coverImg:'',
|
||||||
|
remark:''
|
||||||
|
}
|
||||||
|
this.coverFileList = []
|
||||||
|
this.materialFileList = []
|
||||||
|
},
|
||||||
async handleOpen(item,title) { // 添加按钮
|
async handleOpen(item,title) { // 添加按钮
|
||||||
|
this.addCourseForm = {}
|
||||||
|
this.resetForm()
|
||||||
this.title = title
|
this.title = title
|
||||||
await this.getExamSubjectList()
|
await this.getExamSubjectList()
|
||||||
this.dialogVisible = true
|
this.dialogVisible = true
|
||||||
@ -318,7 +349,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
materialExceedFn(files, fileList){ // 学习资料--超出上传限制数量回调该方法
|
materialExceedFn(files, fileList){ // 学习资料--超出上传限制数量回调该方法
|
||||||
this.$message.warning('已经上传了5个文件啦!');
|
this.$message.warning('已经上传了1个文件啦!');
|
||||||
},
|
},
|
||||||
coverHandleRemove(file, coverFileList) { // 课程封面--上传成功后--移除课程封面
|
coverHandleRemove(file, coverFileList) { // 课程封面--上传成功后--移除课程封面
|
||||||
this.coverFileList = coverFileList
|
this.coverFileList = coverFileList
|
||||||
@ -351,7 +382,9 @@ export default {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
submitBtn() { // 提交按钮
|
submitBtn(addCourseForm) { // 提交按钮
|
||||||
|
this.$refs[addCourseForm].validate((valid) =>{
|
||||||
|
if(valid){
|
||||||
if(this.studyCycle.length > 0){
|
if(this.studyCycle.length > 0){
|
||||||
console.log('==========studyCycle-submitBtn==========',this.studyCycle)
|
console.log('==========studyCycle-submitBtn==========',this.studyCycle)
|
||||||
this.addCourseForm.beginTime = this.studyCycle[0]
|
this.addCourseForm.beginTime = this.studyCycle[0]
|
||||||
@ -394,6 +427,10 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
console.log('==========addCourseForm-submitBtn==========',this.addCourseForm)
|
console.log('==========addCourseForm-submitBtn==========',this.addCourseForm)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
sizeChange(val) { // pageSize的处理
|
sizeChange(val) { // pageSize的处理
|
||||||
this.pagInfo.pageSize = val
|
this.pagInfo.pageSize = val
|
||||||
|
|||||||
@ -99,8 +99,7 @@ export default {
|
|||||||
},
|
},
|
||||||
watch:{
|
watch:{
|
||||||
dialogVisible(newVal,oldVal){
|
dialogVisible(newVal,oldVal){
|
||||||
// this.getExamSubjectList()
|
|
||||||
// if(newVal === false) this.subjectInfo = {}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user