Commit a0113236 authored by 王飞龙's avatar 王飞龙

课程管理修改

parent d2187261
......@@ -4,7 +4,7 @@
<div v-show="showSwitch.courseContent" class="courseContent">
<div class="search" style="border-bottom: 14px solid #f4f4f4">
<el-form ref="queryForm" style="padding: 0 0 0 10px" :model="queryParams" :inline="true">
<el-form-item label="课程名称" prop="roleName">
<el-form-item label="课程名称" prop="lessonName">
<el-input v-model="queryParams.coursekey" placeholder="课程名称" :maxlength="15" style="margin-right: 15px" />
</el-form-item>
<el-form-item label="适用岗位" prop="value">
......@@ -30,7 +30,7 @@
<el-form-item label="难度等级" prop="value2">
<el-select v-model="queryParams.value2" placeholder="难度等级" clearable>
<el-option
v-for="item in value2Options"
v-for="item in difficultyOptions"
:key="item.value"
:label="item.label"
:value="item.value"
......@@ -38,7 +38,7 @@
</el-select>
</el-form-item>
<el-form-item label="课程讲师" prop="value3">
<el-select v-model="queryParams.value3" placeholder="课程讲师" clearable>
<el-select v-model="queryParams.teacherName" placeholder="课程讲师" clearable>
<el-option
v-for="item in value3Options"
:key="item.value"
......@@ -85,22 +85,22 @@
@click="handleAdd"
>{{ commonField.addName }}</el-button>
<!-- //下载模板按钮-->
<!-- <el-button-->
<!-- :class="commonField.importClass"-->
<!-- :type="commonField.typeWarning"-->
<!-- :icon="commonField.importIcon"-->
<!-- :size="commonField.smallSize"-->
<!-- @click="exportmould"-->
<!-- >下载模板</el-button>-->
<!-- &lt;!&ndash; //导入按钮&ndash;&gt;-->
<!-- <el-button-->
<!-- :class="commonField.importClass"-->
<!-- :type="commonField.typeWarning"-->
<!-- :icon="commonField.importIcon"-->
<!-- :size="commonField.smallSize"-->
<!-- @click="importmould"-->
<!-- >{{ commonField.importName }}</el-button>-->
<!-- <input id="btn_file" type="file" style="display:none" @change="fileupload">-->
<!-- <el-button-->
<!-- :class="commonField.importClass"-->
<!-- :type="commonField.typeWarning"-->
<!-- :icon="commonField.importIcon"-->
<!-- :size="commonField.smallSize"-->
<!-- @click="exportmould"-->
<!-- >下载模板</el-button>-->
<!-- &lt;!&ndash; //导入按钮&ndash;&gt;-->
<!-- <el-button-->
<!-- :class="commonField.importClass"-->
<!-- :type="commonField.typeWarning"-->
<!-- :icon="commonField.importIcon"-->
<!-- :size="commonField.smallSize"-->
<!-- @click="importmould"-->
<!-- >{{ commonField.importName }}</el-button>-->
<!-- <input id="btn_file" type="file" style="display:none" @change="fileupload">-->
</el-form-item>
</div>
</el-form>
......@@ -110,8 +110,8 @@
<!-- <el-form-item label="课程编号" :label-width="formLabelWidth" prop="id">-->
<!-- <el-input v-model="form.id" auto-complete="off" :maxlength="11"></el-input>-->
<!-- </el-form-item>-->
<el-form-item label="课程名称" prop="name">
<el-input v-model="form.name" auto-complete="off" placeholder="课程名称" :maxlength="15" />
<el-form-item label="课程名称" prop="lessonName">
<el-input v-model="form.lessonName" auto-complete="off" placeholder="课程名称" :maxlength="15" />
</el-form-item>
<el-form-item label="课时数" prop="name">
<el-input v-model="form.name" auto-complete="off" placeholder="课时数" :maxlength="15" />
......@@ -142,9 +142,9 @@
/>
</el-select>
</el-form-item>
<el-form-item label="课程讲师" prop="name">
<el-input v-model="form.name" auto-complete="off" placeholder="课时数" :maxlength="15" />
</el-form-item>
<el-form-item label="课程讲师" prop="teacherName">
<el-input v-model="form.teacherName" auto-complete="off" placeholder="课时数" :maxlength="15" />
</el-form-item>
<el-form-item label="难度等级" prop="value2">
<el-select v-model="form.value2" placeholder="难度等级" clearable>
<el-option
......@@ -238,11 +238,11 @@
<span>{{ scope.row.id }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="封面" prop="imageSrc">
<el-table-column align="center" label="封面" prop="defaultUrl">
<template slot-scope="scope">
<div :id="step(scope.$index)">
<el-image
:src="scope.row.imageSrc"
:src="scope.row.defaultUrl"
:preview-src-list="scope.row.srclist"
style="width:100%;height:100%;"
@click="handleClickStop(scope.$index)"
......@@ -252,47 +252,64 @@
</div>
</template>
</el-table-column>
<el-table-column align="center" prop="tlessonName" label="课程名称" width="150" :show-overflow-tooltip="true">
<el-table-column align="center" prop="lessonName" label="课程名称" width="150" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span style="max-width: 150px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap" :title="scope.row.tlessonName">{{ scope.row.tlessonName }}</span>
<span> {{ scope.row.lessonName }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="适用岗位" prop="directionName" :show-overflow-tooltip="true">
<el-table-column align="center" label="课时数" prop="classHour" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>前端开发、后端开发</span>
<span>{{ scope.row.classHour }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="技术方向" prop="directionName" :show-overflow-tooltip="true">
<el-table-column align="center" label="课程方案" prop="classPlan" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ scope.row.directionName }}</span>
<span>{{ scope.row.classPlan }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="难度" prop="directionName" :show-overflow-tooltip="true">
<el-table-column align="center" label="岗位分类" prop="jobClassify" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>中级</span>
<span>{{ getCourseDirectionName(scope.row.jobClassify) }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="介绍" prop="directionName" :show-overflow-tooltip="true">
<el-table-column align="center" label="技术分类" prop="tecClassify" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>用 vue 构建用户界面,解决了 jQuery + 模板引擎 的诸多痛点,极大的提高了开发的效率和体验</span>
<span>{{ getJobClassificationName(scope.row.tecClassify) }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="老师" prop="classHour" :show-overflow-tooltip="true">
<el-table-column align="center" label="难度等级" prop="difficultyClassify" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>彭婷利</span>
<span>{{ getDifficultyLevelName(scope.row.difficultyClassify) }}</span>
</template>
</el-table-column>
<!-- <el-table-column align="center" label="学分" prop="credits">-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{scope.row.credits}}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column align="center" label="价格(元)" prop="classHour" :show-overflow-tooltip="true">
<el-table-column align="center" label="一句话介绍" prop="lessonBrief" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ scope.row.classHour }}</span>
<span>{{ scope.row.lessonBrief }}</span>
</template>
</el-table-column>
<!-- 课程讲师-->
<el-table-column align="center" label="课程讲师" prop="teacherName" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ scope.row.teacherName }}</span>
</template>
</el-table-column>
<!-- 价格-->
<el-table-column align="center" label="价格" prop="lessonPrice" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ scope.row.lessonPrice }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="首页显示" prop="homeDisplay" :show-overflow-tooltip="true">
<template slot-scope="scope">
<el-switch
v-model="homeDisplay"
active-value="1"
inactive-value="0"
@change="handleStatusChange(scope.row)"
/>
</template>
</el-table-column>
<el-table-column align="center" label="状态" prop="classHour" :show-overflow-tooltip="true">
<el-table-column align="center" label="课程状态" prop="flag" :show-overflow-tooltip="true">
<template slot-scope="scope">
<el-switch
v-model="flag"
......@@ -302,6 +319,31 @@
/>
</template>
</el-table-column>
<el-table-column align="center" label="企业精品课" prop="entQualityLesson" :show-overflow-tooltip="true">
<template slot-scope="scope">
<el-switch
v-model="entQualityLesson"
active-value="1"
inactive-value="0"
@change="handleStatusChange(scope.row)"
/>
</template>
</el-table-column>
<el-table-column align="center" label="院校精品课" prop="schoolQualityLesson" :show-overflow-tooltip="true">
<template slot-scope="scope">
<el-switch
v-model="schoolQualityLesson"
active-value="1"
inactive-value="0"
@change="handleStatusChange(scope.row)"
/>
</template>
</el-table-column>
<el-table-column align="center" label="课程介绍" prop="lessonDescription" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ scope.row.lessonDescription }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="250">
<template slot-scope="scope">
<el-button
......@@ -332,7 +374,7 @@
<!-- <el-button type="text" @click="removeCourse(scope.$index)">删除</el-button>-->
</template>
</el-table-column>
</el-table>
</el-table-column></el-table>
</div>
<pagination
v-show="total>0"
......@@ -393,6 +435,7 @@ import {
defaultUrl, picImport
} from '@/api/courseManagement/indexApi'
import commonField from '@/utils/commonField'
import { getDict } from '@/api/system/dict/data'
export default {
name: 'Index',
components: {
......@@ -466,26 +509,17 @@ export default {
value2: '',
value3: '',
value4: '',
value5: '',
value5: ''
},
// 课程方向
courseDirection: [],
valueOptions: [
{ value: '1', label: '前端开发' },
{ value: '2', label: '后端开发' }
],
value2Options: [
{ value: '1', label: '初级' },
{ value: '2', label: '中级' },
{ value: '3', label: '高级' }
difficultyOptions: [
],
value3Options: [
{ value: '1', label: '张三' },
{ value: '2', label: '李四' }
],
value4Options: [
{ value: '1', label: '已发布' },
{ value: '2', label: '未发布' }
],
formLabelWidth: '90px',
// 表格
......@@ -522,6 +556,7 @@ export default {
coursekey: '',
searchByDirection: ''
},
coursePlanOptions: [],
// pagination
total: 0,
......@@ -579,6 +614,10 @@ export default {
created() {
},
mounted: function() {
this.getCourseDirection()
this.getJobClassification()
this.getDifficultyLevel()
this.getCoursePlan()
this.loadData()
},
methods: {
......@@ -616,27 +655,6 @@ export default {
})
})
},
// 获取课程方向
getCourseDirection() {
const that = this
that.fullscreenLoading = true
queryDirectionsList().then(res => {
for (let i = 0; i < res.data.length; i++) {
const obj = {}
obj.value = res.data[i].id
obj.label = res.data[i].text
that.courseDirection[i] = obj
}
that.fullscreenLoading = false
}).catch((err) => {
that.fullscreenLoading = false
that.$notify({
title: '失败',
message: '网络错误,课程方向获取失败',
type: 'error'
})
})
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams = {
......@@ -665,30 +683,31 @@ export default {
var pages = res.rows// 查询过来的每页数据
_this.total = res.total// 总记录数
_this.bussid = []
for (let i = 0; i < pages.length; i++) {
var obj = {}
obj.id = i + 1
obj.tcode = pages[i].code
obj.tlessonName = pages[i].lessonName
obj.bussinessId = pages[i].businessId
obj.tname = pages[i].name
obj.tsex = (pages[i].sex == '1') ? '女' : '男'
obj.imageSrc = pages[i].defaultUrl ? pages[i].defaultUrl : require('@/assets/image/test.png')
obj.srclist = []
obj.srclist.push(obj.imageSrc)
obj.directionId = pages[i].directionId
obj.directionName = pages[i].directionName
obj.directionCode = pages[i].directionCode
obj.classHour = pages[i].classHour
obj.chapterClassHour = pages[i].chapterClassHour
obj.credits = pages[i].credits
obj.credit = pages[i].credits
obj.totalStuHours = pages[i].classHour
_this.bussid.push(pages[i].businessId)
// obj.imageSrc="http://imgsrc.baidu.com/image/c0%3Dshijue1%2C0%2C0%2C294%2C40/sign=60aeee5da74bd11310c0bf7132c6ce7a/72f082025aafa40fe3c0c4f3a164034f78f0199d.jpg";
data[i] = obj
}
_this.tableData = data
// for (let i = 0; i < pages.length; i++) {
// var obj = {}
// obj.id = i + 1
// obj.tcode = pages[i].code
// obj.tlessonName = pages[i].lessonName
// obj.bussinessId = pages[i].businessId
// obj.tname = pages[i].name
// obj.tsex = (pages[i].sex == '1') ? '女' : '男'
// obj.imageSrc = pages[i].defaultUrl ? pages[i].defaultUrl : require('@/assets/image/test.png')
// obj.srclist = []
// obj.srclist.push(obj.imageSrc)
// obj.directionId = pages[i].directionId
// obj.directionName = pages[i].directionName
// obj.directionCode = pages[i].directionCode
// obj.classHour = pages[i].classHour
// obj.chapterClassHour = pages[i].chapterClassHour
// obj.credits = pages[i].credits
// obj.credit = pages[i].credits
// obj.totalStuHours = pages[i].classHour
// _this.bussid.push(pages[i].businessId)
// // obj.imageSrc="http://imgsrc.baidu.com/image/c0%3Dshijue1%2C0%2C0%2C294%2C40/sign=60aeee5da74bd11310c0bf7132c6ce7a/72f082025aafa40fe3c0c4f3a164034f78f0199d.jpg";
// data[i] = obj
// }
_this.tableData = pages
console.log('tableData', _this.tableData)
_this.fullscreenLoading = false
if (res.rows.length === 0) {
_this.tableDataTips = '暂无数据'
......@@ -701,6 +720,61 @@ export default {
_this.uploadList.fm = this.interfaceUrl + 'BLesson/picImport'
_this.getCourseDirection()
},
// 获取课程方案
getCoursePlan() {
getDict('class_plan').then(res => {
this.coursePlanOptions = res.data
console.log('课程方案', this.coursePlanOptions)
})
},
// 获取岗位类型
getJobClassification() {
getDict('job_classify').then(res => {
this.valueOptions = res.data
})
},
// 获取技术分类
getCourseDirection() {
getDict('tec_classify').then(res => {
this.courseDirection = res.data
})
},
// 根据岗位的id获取岗位的名称
getJobClassificationName(dictValue) {
let name = ''
this.valueOptions.forEach(item => {
if (item.dictValue === dictValue) {
name = item.dictLabel
}
})
return name
},
// 根据技术分类的id获取技术分类的名称
getCourseDirectionName(dictValue) {
let name = ''
this.courseDirection.forEach(item => {
if (item.dictValue === dictValue) {
name = item.dictLabel
}
})
return name
},
// 获取难度等级
getDifficultyLevel() {
getDict('difficulty_grade').then(res => {
this.difficultyOptions = res.data
})
},
// 根据难度等级的id获取难度等级的名称
getDifficultyLevelName(dictValue) {
let name = ''
this.difficultyOptions.forEach(item => {
if (item.dictValue === dictValue) {
name = item.dictLabel
}
})
return name
},
// 新增课程
createClass(formName) {
......
......@@ -52,14 +52,14 @@
<span>{{ scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column prop="userType" label="用户类型" show-overflow-tooltip >
<el-table-column prop="userType" label="用户类型" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.userType === '1' ? '单位' : '个人' }}
</template>
</el-table-column>
<el-table-column prop="applicant" label="申请人">
<template slot-scope="scope">
{{ scope.row.applicantName }}
{{ scope.row.applicantName }}({{ scope.row.applicantUserName }})
</template>
</el-table-column>
<el-table-column prop="applicantUnitName" label="申请单位" show-overflow-tooltip />
......@@ -269,7 +269,7 @@ export default {
},
// 日期格式转换
replace(time) {
return parseTime(time, '{y}/{m}/{d}:{h}:{i}')
return parseTime(time, '{y}-{m}-{d}:{h}:{i}')
},
submit() {
console.log('this,form', this.form)
......
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