Merge branch 'bjxz-cjw' into bjxz-dev

This commit is contained in:
Vce 2024-05-23 23:05:04 +08:00
commit 8b2f1123aa
4 changed files with 129 additions and 126 deletions

View File

@ -73,9 +73,6 @@
<el-input-number :min="0" :max="100" :controls="false" :precision="0" style="width: 190px" v-model="examForm.passLine"></el-input-number>
<span style="margin-left: 10px;color:#a6a7b2;"></span>
</el-form-item>
<!-- <el-form-item label="学习周期" prop="studyCycle">
<el-date-picker v-model="examForm.studyCycle" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
</el-form-item> -->
<el-form-item label="备注" prop="remark">
<el-input type="textarea" rows="3" :show-word-limit="true" v-model="examForm.remark"></el-input>
</el-form-item>
@ -138,17 +135,18 @@
</template>
</el-table-column>
<el-table-column prop="difficulty" align="center" width="80px" label="难易程度">
<template slot-scope="scope">
<div>{{ scope.row.difficulty && levelArr[scope.row.difficulty - 1].name }}</div>
</template>
</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="isEnable" align="center" width="100px" label="状态">
<template slot-scope="scope">
<div :style="scope.row.isEnable == 1 ? 'color: green' : 'color: red'">{{ scope.row.isEnable == 1 ? "已应用" : "未应用" }}</div>
</template>
</el-table-column>
<template slot-scope="scope">
<div>{{ scope.row.difficulty && levelArr[scope.row.difficulty - 1].name }}</div>
</template>
</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="createTime" align="center" width="170px" label="创建时间"></el-table-column>
<el-table-column prop="isEnable" align="center" width="100px" label="状态">
<template slot-scope="scope">
<div :style="scope.row.isEnable == 1 ? 'color: green' : 'color: red'">{{ scope.row.isEnable == 1 ? "已应用" : "未应用" }}</div>
</template>
</el-table-column>
</el-table>
<!-- <el-pagination class="pagerBox" @size-change="sizeChange" @current-change="currentChange" :current-page="question.pageNo" :page-sizes="$store.state.PAGESIZRS" :page-size="question.pageSize" layout="total, sizes, prev, pager, next" :total="Number(question.total)" background></el-pagination> -->
</div>
@ -163,29 +161,29 @@
<div class="dialogContainer3">
<div>
<div style="margin-left:56px;margin-bottom:20px">
<el-radio-group v-model="randomQuestion.radio" @input="handleSelect">
<el-radio-group v-model="randomQuestion.radio" @input="handleSelect" clearable>
<el-radio label="0">从指定科目类型中选择</el-radio>
<el-radio label="1">从全部题库中选择</el-radio>
</el-radio-group><br>
<el-select v-model="randomQuestion.name" :disabled="isDisabled" size="mini" placeholder="请选择" style="margin-top: 5px">
<el-select v-model="randomQuestion.name" :disabled="isDisabled" size="mini" placeholder="请选择" style="margin-top: 5px" clearable>
<el-option :label="item.name" :value="item.id" v-for="(item,i) in subjectNameList" :key="i"></el-option>
<!-- <el-option v-for="item in subjectNameList" :key="item.value" :label="item.name" :value="item.value"></el-option> -->
</el-select>
</div>
<div>
<div>单选题:
<el-select v-model="randomQuestion.examSingle.diffculty" @change="singleChange" size="mini" placeholder="请选择难易程度" style="margin-top: 5px">
<el-select v-model="randomQuestion.examSingle.diffculty" @change="singleChange" size="mini" placeholder="请选择难易程度" style="margin-top: 5px" clearable>
<el-option v-for="item in levelArr" :key="item.value" :label="item.name" :value="item.value"></el-option>
</el-select>
<el-select ref="singleRef" v-model="randomQuestion.examSingle.count" size="mini" placeholder="请选择" style="margin-top: 5px;margin-left:5px">
<el-select ref="singleRef" v-model="randomQuestion.examSingle.count" size="mini" placeholder="请选择" style="margin-top: 5px;margin-left:5px" clearable>
<el-option v-for="item in radioDataList" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select> 当前题库单选题{{radioDataList.length}}
</div>
<div>多选题:
<el-select v-model="randomQuestion.examMultiple.diffculty" @change="multipleChange" size="mini" placeholder="请选择难易程度" style="margin-top: 5px">
<el-select v-model="randomQuestion.examMultiple.diffculty" @change="multipleChange" size="mini" placeholder="请选择难易程度" style="margin-top: 5px" clearable>
<el-option v-for="item in levelArr" :key="item.value" :label="item.name" :value="item.value"></el-option>
</el-select>
<el-select v-model="randomQuestion.examMultiple.count" size="mini" placeholder="请选择" style="margin-top: 5px;margin-left:5px">
<el-select v-model="randomQuestion.examMultiple.count" size="mini" placeholder="请选择" style="margin-top: 5px;margin-left:5px" clearable>
<el-option v-for="item in checkDataList" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select> 当前题库多选题{{checkDataList.length}}
</div>
@ -252,6 +250,7 @@
</div>
</template>
</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>
@ -508,22 +507,9 @@ export default {
showBigImg: false,
examSubjectList: [], //
laborPersonList: [], //
adminPersonList: [], //
tempPersonList: [], //
checkedPersonList: [], //
personTotal: 0, //
personCheckedTotal: 0, //
compulsoryList: [], //
compulsoryList: [], //
cpsCheckedList:[], //
cpsFormList: [], //
cpsTotal: [], //
cpsCheckedTotal: [], //
compulsoryList: [],
addCourseForm: {}, //
studyCycle: [], //
personType: 0, //
personnelName:"", //
@ -610,11 +596,11 @@ export default {
},
methods: {
cancel2(){
this.examForm.checkQuestionType = null
// this.examForm.checkQuestionType = null
this.dialogVisible2 = false
},
cancel3(){
this.examForm.checkQuestionType = null
// this.examForm.checkQuestionType = null
this.dialogVisible3 = false
},
singleChange(){
@ -772,42 +758,26 @@ export default {
},
openDoor(){
// this.examForm.questions = this.examForm.questions.split(',')
let tempStr = this.examForm.questions.split(',')
console.log(tempStr,789)
console.log(this.questionList,789)
// this.examForm.questions = String.prototype.split(this.examForm.questions,',')
// this.$nextTick(()=>{
// this.examForm.questions = tempStr
// this.questionList.map((item,index) => {
// console.log("33333333333333333333")
// tempStr.map((item2,index2) => {
// if(item.id = item2){
// that.$refs.questionListTable.toggleRowSelection(taht.questionList[index],true)
// console.log("=======================")
// console.log(this.questionList[index])
// }
// })
// })
// })
this.dialogVisible2 = true
this.$nextTick(() => {
for(let i=0;i<this.questionList.length;i++){
for(let j = 0;j<tempStr.length;j++){
if(tempStr[j] == this.questionList[i].id){
this.$refs.questionListTable.toggleRowSelection(this.questionList[i],true)
if(this.title === '编辑考试'){
let tempStr = this.examForm.questions.split(',')
this.$nextTick(() => {
for(let i=0;i<this.questionList.length;i++){
for(let j = 0;j<tempStr.length;j++){
if(tempStr[j] == this.questionList[i].id){
this.$refs.questionListTable.toggleRowSelection(this.questionList[i],true)
}
}
}
}
})
})
}
this.dialogVisible2 = true
},
//
async editExam(row) { //
this.personType = 1
this.title = "编辑考试";
// console.log(row);
this.examForm = row
this.examForm = JSON.parse(JSON.stringify(row))
@ -936,6 +906,7 @@ export default {
},
// select
handleSelect(val){
this.randomQuestion.name = ''
this.clearFilter();
if(val === '0') {
this.isDisabled = false

View File

@ -75,15 +75,18 @@
<div class="dialogContainer">
<div class="dialogLeft">
<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-option :label="item.name" :value="item.id" v-for="(item,i) in examSubjectList" :key="i"></el-option>
</el-select>
</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-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>
<el-upload class="upload-demo" drag multiple name="files" :limit="1" :action="$store.state.UPLOADURL"
accept=".mp4"
@ -96,7 +99,8 @@
<div class="el-upload__text"><i style="font-size: 18px;" class="el-icon-upload"></i>将文件拖到此处<em>点击上传</em></div>
</el-upload>
</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"
:on-remove="(file, fileList) => coverHandleRemove(file, fileList)"
:on-success="(res, file) => coverHandleSuccess(res, file)"
@ -163,7 +167,13 @@ export default {
materialFileList: [], //
coverFileList: [], //
addCourseForm: {}, //
addCourseForm: {
subjectId:'',
courseName:'',
fileUrl:'',
coverImg:'',
remark:''
}, //
studyCycle: [], //
personType: 1, //
@ -201,6 +211,14 @@ export default {
},
mounted() {},
watch:{
dialogVisible(newV,oldV){
if(newV === false){
this.$refs.addCourseForm.resetFields()
}
if(this.title === '新增课程'){
this.$refs.addCourseForm.resetFields()
}
}
},
methods: {
//
@ -278,7 +296,20 @@ export default {
}
})
},
resetForm(){
this.addCourseForm = {
subjectId:'',
courseName:'',
fileUrl:'',
coverImg:'',
remark:''
}
this.coverFileList = []
this.materialFileList = []
},
async handleOpen(item,title) { //
this.addCourseForm = {}
this.resetForm()
this.title = title
await this.getExamSubjectList()
this.dialogVisible = true
@ -318,7 +349,7 @@ export default {
}
},
materialExceedFn(files, fileList){ // --
this.$message.warning('已经上传了5个文件啦!');
this.$message.warning('已经上传了1个文件啦!');
},
coverHandleRemove(file, coverFileList) { // ----
this.coverFileList = coverFileList
@ -351,49 +382,55 @@ export default {
return false;
}
},
submitBtn() { //
if(this.studyCycle.length > 0){
console.log('==========studyCycle-submitBtn==========',this.studyCycle)
this.addCourseForm.beginTime = this.studyCycle[0]
this.addCourseForm.endTime = this.studyCycle[1]
}
this.addCourseForm.projectSn = this.$store.state.projectSn;
// this.addCourseForm.coverImg = this.coverFileList
// this.addCourseForm.fileList = this.materialFileList
if(!this.addCourseForm.subjectId){
this.$message.error('请选择科目类型')
return
}
if(!this.addCourseForm.courseName){
this.$message.error('请输入课程名称')
return
}
if(!this.addCourseForm.fileUrl){
this.$message.error('请上传视频文件')
return
}
if(!this.addCourseForm.coverImg){
this.$message.error('请上传课程封面')
return
}
if(this.title === '新增课程'){
addCourseApi(this.addCourseForm).then((res)=>{
if (res.code == 200) {
this.handleClose()
this.$message.success(res.result);
this.getPageCourseApi();
submitBtn(addCourseForm) { //
this.$refs[addCourseForm].validate((valid) =>{
if(valid){
if(this.studyCycle.length > 0){
console.log('==========studyCycle-submitBtn==========',this.studyCycle)
this.addCourseForm.beginTime = this.studyCycle[0]
this.addCourseForm.endTime = this.studyCycle[1]
}
})
}else{
editCourseApi(this.addCourseForm).then((res)=>{
if (res.code == 200) {
this.handleClose()
this.$message.success('编辑成功');
this.getPageCourseApi();
this.addCourseForm.projectSn = this.$store.state.projectSn;
// this.addCourseForm.coverImg = this.coverFileList
// this.addCourseForm.fileList = this.materialFileList
if(!this.addCourseForm.subjectId){
this.$message.error('请选择科目类型')
return
}
})
}
console.log('==========addCourseForm-submitBtn==========',this.addCourseForm)
if(!this.addCourseForm.courseName){
this.$message.error('请输入课程名称')
return
}
if(!this.addCourseForm.fileUrl){
this.$message.error('请上传视频文件')
return
}
if(!this.addCourseForm.coverImg){
this.$message.error('请上传课程封面')
return
}
if(this.title === '新增课程'){
addCourseApi(this.addCourseForm).then((res)=>{
if (res.code == 200) {
this.handleClose()
this.$message.success(res.result);
this.getPageCourseApi();
}
})
}else{
editCourseApi(this.addCourseForm).then((res)=>{
if (res.code == 200) {
this.handleClose()
this.$message.success('编辑成功');
this.getPageCourseApi();
}
})
}
console.log('==========addCourseForm-submitBtn==========',this.addCourseForm)
}
})
},
sizeChange(val) { // pageSize
this.pagInfo.pageSize = val

View File

@ -99,8 +99,7 @@ export default {
},
watch:{
dialogVisible(newVal,oldVal){
// this.getExamSubjectList()
// if(newVal === false) this.subjectInfo = {}
}
},
computed: {

View File

@ -94,7 +94,7 @@
<div class="item-flex">
<el-form-item label="选择课件" prop="courseId" >
<!-- :rules="[{required:true, message:'必填', trigger:'change'}]"> -->
<el-select v-model="addCourseForm.courseId" placeholder="请选择课件">
<el-select v-model="addCourseForm.courseId" placeholder="请选择课件" clearable>
<el-option :label="item.courseName" :value="item.id" v-for="(item, i) in courseList"
:key="i"></el-option>
</el-select>
@ -103,7 +103,7 @@
<div class="item-flex">
<el-form-item label="选择试卷" prop="examPaperId" >
<!-- :rules="[{required:true, message:'必填', trigger:'change'}]"> -->
<el-select v-model="addCourseForm.examPaperId" placeholder="请选择试卷">
<el-select v-model="addCourseForm.examPaperId" placeholder="请选择试卷" clearable>
<el-option :label="item.name" :value="item.id" v-for="(item, i) in examPaperSubjectList"
:key="i"></el-option>
</el-select>
@ -478,7 +478,7 @@ export default {
pageNo: this.worker.pageNo,
// pageSize: this.worker.pageSize,
pageSize: 999999,
// presence: 1,
presence: 1,
departmentId:'',
teamId:'',
}
@ -528,7 +528,10 @@ export default {
// return
// };
// this.active++;
if(!this.addCourseForm.courseId && !this.addCourseForm.examPaperId){
this.$message.error('试卷和课件至少选择一项')
return
}
this.$refs[examForm].validate((valid) => {
if(valid){
if(this.active == 1) {
@ -565,13 +568,6 @@ export default {
// this.$message.error('')
// return
// }
if(!this.addCourseForm.courseId && !this.addCourseForm.examPaperId){
this.$message.error('试卷和课件至少选择一项')
return
}
},
last() {
if(this.active == 2) {
@ -702,8 +698,8 @@ export default {
pageNo: this.pagInfo.pageNo,
pageSize: this.pagInfo.pageSize,
subjectId: this.subjectId,
trainBeginTime: this.starEndTime?this.starEndTime[0]:'',
trainEndTime: this.starEndTime?this.starEndTime[1]:'',
trainBeginTime_begin: this.starEndTime?this.starEndTime[0]:'',
trainEndTime_end: this.starEndTime?this.starEndTime[1]:'',
projectSn: this.$store.state.projectSn,
}).then((result) => {
if (result.success) {