Commit 56c8c0c1 authored by 王飞龙's avatar 王飞龙

课程管理 课程编辑修改

parent fbd0e415
...@@ -9,6 +9,22 @@ export function queryBLessonsByPagination(query) { ...@@ -9,6 +9,22 @@ export function queryBLessonsByPagination(query) {
params: query params: query
}) })
} }
// 课程管理查询详细信息
export function detailBLesson(businessId) {
return request({
url: '/blesson/detail/' + businessId,
method: 'get'
})
}
// 修改课程管理
export function updateBLesson(data) {
data = Qs.stringify(data)
return request({
url: '/blesson/update/' + data.businessId,
method: 'put',
data
})
}
// 课程管理目录查询 // 课程管理目录查询
export function queryBChaptersWithoutAuth(query) { export function queryBChaptersWithoutAuth(query) {
return request({ return request({
......
...@@ -48,8 +48,8 @@ ...@@ -48,8 +48,8 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="课程讲师" prop="teacherName"> <el-form-item label="课程讲师" prop="lessonTeaName">
<el-select v-model="queryParams.teacherName" placeholder="课程讲师" clearable> <el-select v-model="queryParams.lessonTeaName" placeholder="课程讲师" clearable>
<el-option <el-option
v-for="(item,index) in teacherOptions" v-for="(item,index) in teacherOptions"
:key="index" :key="index"
...@@ -374,8 +374,8 @@ ...@@ -374,8 +374,8 @@
:class="commonField.updateClass" :class="commonField.updateClass"
:type="commonField.typeParent" :type="commonField.typeParent"
:size="commonField.size" :size="commonField.size"
@click="picturecover(scope.$index,scope.row)" @click="updateInfo(scope.row)"
>修改封面</el-button> >编辑</el-button>
<el-button <el-button
:class="commonField.updateClass" :class="commonField.updateClass"
:type="commonField.typeParent" :type="commonField.typeParent"
...@@ -710,7 +710,7 @@ export default { ...@@ -710,7 +710,7 @@ export default {
tecClassify: '', tecClassify: '',
difficultyClassify: '', difficultyClassify: '',
lessonBrief: '', lessonBrief: '',
teacherName: '', lessonTeaName: '',
lessonPrice: '', lessonPrice: '',
homeDisplay: '', homeDisplay: '',
flag: '', flag: '',
...@@ -798,6 +798,19 @@ export default { ...@@ -798,6 +798,19 @@ export default {
} }
}) })
}, },
/**
* 编辑
*
*/
updateInfo(row) {
this.$router.push({
path: '/courseInformation/courseManagement/info/update',
query: {
status: '2',
businessId: row.businessId
}
})
},
step(index) { step(index) {
return 'step' + index return 'step' + index
}, },
...@@ -832,7 +845,7 @@ export default { ...@@ -832,7 +845,7 @@ export default {
tecClassify: '', tecClassify: '',
difficultyClassify: '', difficultyClassify: '',
lessonBrief: '', lessonBrief: '',
teacherName: '', lessonTeaName: '',
lessonPrice: '', lessonPrice: '',
homeDisplay: '', homeDisplay: '',
flag: '', flag: '',
...@@ -954,10 +967,9 @@ export default { ...@@ -954,10 +967,9 @@ export default {
tecClassify: _this.queryParams.tecClassify, tecClassify: _this.queryParams.tecClassify,
difficultyClassify: _this.queryParams.difficultyClassify, difficultyClassify: _this.queryParams.difficultyClassify,
lessonBrief: _this.queryParams.lessonBrief, lessonBrief: _this.queryParams.lessonBrief,
teacherName: _this.queryParams.teacherName, lessonTeaName: _this.queryParams.lessonTeaName,
lessonPrice: _this.queryParams.lessonPrice, lessonPrice: _this.queryParams.lessonPrice,
homeDisplay: _this.queryParams.homeDisplay, homeDisplay: _this.queryParams.homeDisplay,
lessonTeaName: _this.queryParams.lessonTeaName,
flag: _this.queryParams.flag, flag: _this.queryParams.flag,
schoolQualityLesson: _this.queryParams.schoolQualityLesson, schoolQualityLesson: _this.queryParams.schoolQualityLesson,
entQualityLesson: _this.queryParams.entQualityLesson, entQualityLesson: _this.queryParams.entQualityLesson,
......
<template> <template>
<div class="addCourse"> <div class="addCourse">
<div class="CourseTitle"> <div class="CourseTitle">
<div v-if="status=== '1'" class="title">{{ title }}</div> <div class="title">{{ title }}</div>
</div> </div>
<div class="CourseContent"> <div class="CourseContent">
<el-form ref="courseRef" :model="form" :rules="rules" label-position="right" label-width="auto"> <el-form ref="courseRef" :model="form" :rules="rules" label-position="right" label-width="auto">
...@@ -87,9 +87,9 @@ ...@@ -87,9 +87,9 @@
<el-row :gutter="100"> <el-row :gutter="100">
<!-- "--> <!-- "-->
<el-col :span="12"> <el-col :span="12">
<el-form-item label="课程讲师:" prop="teacherName" :rules="[{ required: status !== '3', message: '请输入课程讲师', trigger: 'blur' }]"> <el-form-item label="课程讲师:" prop="lessonTeaName" :rules="[{ required: status !== '3', message: '请输入课程讲师', trigger: 'blur' }]">
<el-select <el-select
v-model="form.teacherName" v-model="form.lessonTeaName"
filterable filterable
class="normalSelct" class="normalSelct"
> >
...@@ -206,7 +206,13 @@ ...@@ -206,7 +206,13 @@
<script> <script>
import { uploadPublic } from '@/api/contentManagement/sysContest' import { uploadPublic } from '@/api/contentManagement/sysContest'
import { blessonAdd, queryTeaLessonJobs, queryTeaLessonTecs } from '@/api/courseManagement/indexApi' import {
blessonAdd,
detailBLesson,
queryTeaLessonJobs,
queryTeaLessonTecs,
updateBLesson
} from '@/api/courseManagement/indexApi'
import { getDict } from '@/api/system/dict/data' import { getDict } from '@/api/system/dict/data'
import { listCmsLecturer } from '@/api/courseManagement/cmsLecturer' import { listCmsLecturer } from '@/api/courseManagement/cmsLecturer'
...@@ -287,7 +293,8 @@ export default { ...@@ -287,7 +293,8 @@ export default {
pictureId: '', pictureId: '',
// 课程介绍 // 课程介绍
lessonDescription: '', lessonDescription: '',
flag: '1' flag: '1',
lessonTeaName: ''
}, },
teacherOptions: [], teacherOptions: [],
rules: { rules: {
...@@ -296,8 +303,14 @@ export default { ...@@ -296,8 +303,14 @@ export default {
}, },
created() { created() {
this.getAllDict() this.getAllDict()
// this.getTeaLessonJobs() // 接收路由参数
// this.getTitle() this.status = this.$route.query.status
this.businessId = this.$route.query.businessId
if (this.status === '2') {
this.getLessonDetail()
}
this.getTeaLessonJobs()
this.getTitle()
}, },
methods: { methods: {
getAllDict() { getAllDict() {
...@@ -340,10 +353,14 @@ export default { ...@@ -340,10 +353,14 @@ export default {
// 保存 // 保存
submit() { submit() {
this.$refs.courseRef.validate(valid => { this.$refs.courseRef.validate(valid => {
console.log('this.businessid', this.businessId)
console.log(this.businessid !== null)
console.log(this.businessid !== undefined)
console.log(this.businessid !== '')
if (valid) { if (valid) {
if (this.businessid !== null) { if (this.businessid !== null && this.businessid !== '') {
console.log('更新') console.log('更新')
this.createClass() this.updateClass()
} else { } else {
console.log('添加') console.log('添加')
this.createClass() this.createClass()
...@@ -351,7 +368,13 @@ export default { ...@@ -351,7 +368,13 @@ export default {
} }
}) })
}, },
// 查询课程详情
getLessonDetail() {
detailBLesson(this.businessId).then(res => {
this.form = res.data
// this.imageUrl = res.data.pictureUrl
})
},
// 新增课程 // 新增课程
createClass() { createClass() {
blessonAdd(this.form).then(res => { blessonAdd(this.form).then(res => {
...@@ -368,6 +391,43 @@ export default { ...@@ -368,6 +391,43 @@ export default {
path: '/courseInformation/courseManagement/index' path: '/courseInformation/courseManagement/index'
}) })
}, },
// 修改课程
updateClass() {
const form = {
businessId: this.businessId,
lessonName: this.form.lessonName,
lessonBrief: this.form.lessonBrief,
classHour: this.form.classHour,
classPlan: this.form.classPlan,
jobClassify: this.form.jobClassify,
tecClassify: this.form.tecClassify,
teacherName: this.form.teacherName,
lessonPrice: this.form.lessonPrice,
difficultyClassify: this.form.difficultyClassify,
homeDisplay: this.form.homeDisplay,
entQualityLesson: this.form.entQualityLesson,
schoolQualityLesson: this.form.schoolQualityLesson,
pictureId: this.form.pictureId,
lessonDescription: this.form.lessonDescription,
flag: this.form.flag,
lessonTeaName: this.form.lessonTeaName
}
// 调用了编辑方法
blessonAdd(form).then(res => {
let type = res.code
const message = res.message
type = (type === 200) ? 'success' : 'warning'
this.$notify({
title: type === 'success' ? '成功' : '提示',
message: message,
type: type
})
})
this.$router.push({
path: '/courseInformation/courseManagement/index'
})
},
// 查询讲师 // 查询讲师
getTeacher() { getTeacher() {
const params = { const params = {
...@@ -379,14 +439,6 @@ export default { ...@@ -379,14 +439,6 @@ export default {
console.log('讲师', this.lecturerList) console.log('讲师', this.lecturerList)
}) })
}, },
getTeaLessonJobs() {
queryTeaLessonJobs().then(res => {
console.log('岗位信息', res)
})
queryTeaLessonTecs().then(res => {
console.log('计算信息', res)
})
},
beforeAvatarUpload(file) { beforeAvatarUpload(file) {
// 判断文件是否为图片类型 // 判断文件是否为图片类型
const isJPG = file.type === 'image/jpeg' || file.type === 'image/png' const isJPG = file.type === 'image/jpeg' || file.type === 'image/png'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment