课程管理更新

This commit is contained in:
18571350067 2021-11-01 19:39:27 +08:00
parent cb34056f4c
commit 82dce0315d
6 changed files with 74 additions and 10 deletions

View File

@ -0,0 +1,33 @@
import request from '@/utils/request'
const coursewareApi = {
add: '/courseManagement/xmCourseCourseware/addOrUpdate',
// get: '/courseManagement/course/details',
// update: 'sys/menu/update',
del: 'courseManagement/xmCourseCourseware/delete',
// updateStatus: 'sys/menu/updateStatus',
// list: '/courseManagement/course/listPage',
// coursewareList:'/courseManagement/course/courseware/details',
// questionList:'/courseManagement/course/questionList'
}
//删除课件
export function deleteCourseware (params) {
return request({
url: coursewareApi.del,
method: 'delete',
params: params
})
}
// 课件新增
export function coursewareAdd (params) {
return request({
url: coursewareApi.add,
method: 'post',
data: params
})
}

View File

@ -13,6 +13,8 @@
<a-divider type="vertical" />
<a href="javascript:;" @click="courseWare(record)">课件</a>
<a-divider type="vertical" />
<a href="javascript:;" @click="courseWare(record)">课件预览</a>
<a-divider type="vertical" />
<a-popconfirm title="是否删除?" @confirm="() => del(record)">
<a href="javascript:;">删除</a>
</a-popconfirm>
@ -46,7 +48,7 @@ export default {
{ title: '课程名称', width: 'auto', align: 'center', dataIndex: 'courseName', key: 'courseName' },
{ title: '课时/分', width: '160px', align: 'center', dataIndex: 'hour', key: 'hour' },
{ title: '数量', width: '160px', align: 'center', dataIndex: 'questionCount', key: 'questionCount' },
{ title: '操作', key: 'operation', width: '200px', align: 'center', scopedSlots: { customRender: 'action' } }
{ title: '操作', key: 'operation', width: '300px', align: 'center', scopedSlots: { customRender: 'action' } }
],
}
},
@ -70,7 +72,6 @@ export default {
//
courseAdd(){
console.log("OK你已經死亡");
this.$router.push({ path : '/course/CourseAdd' , query : {}})
},

View File

@ -1,6 +1,11 @@
<template>
<page-header-wrapper :title="false">
<a-card :bordered="false">
<span style="font-size : 20px; margin-left :15px">课件信息</span>
<div class="button" style="width: 100%; height: 32px; margin-bottom: 8px; margin-left: 85%;">
<a-button type="primary" @click="goback">返回</a-button>
<a-button type="primary" @click="coursewareAdd">上传课件</a-button>
</div>
<s-table ref="table" size="default" rowKey="id" :columns="columns" :data="loadData">
<template slot="action" slot-scope="text, record">
<a href="javascript:;" @click="detail(record)">预览</a>
@ -20,6 +25,8 @@
<script>
import { STable, SearchCom } from '@/components'
import { getCoursewareListByCourseId } from '@/api/course/course'
import { deleteCourseware } from '@/api/course/courseware'
import { coursewareAdd } from '@/api/course/courseware'
export default {
components: {
@ -36,8 +43,8 @@ export default {
})
},
columns: [
{ title: '课名称', width: '160px', align: 'center', dataIndex: 'name', key: 'name' },
{ title: '课分类',width: '300px',align: 'center', dataIndex: 'coursewareClassifyId', key: 'coursewareClassifyId',},
{ title: '课名称', width: '160px', align: 'center', dataIndex: 'name', key: 'name' },
{ title: '课分类',width: '300px',align: 'center', dataIndex: 'coursewareClassifyId', key: 'coursewareClassifyId',},
{ title: '课时/分', width: '160px', align: 'center', dataIndex: 'hour', key: 'hour' },
{ title: '课件大小', width: '160px', align: 'center', dataIndex: 'coursewareSize', key: 'coursewareSize' },
{ title: '操作', key: 'operation', width: '200px', align: 'center', scopedSlots: { customRender: 'action' } },
@ -45,10 +52,27 @@ export default {
}
},
methods: {
//
coursewareAdd(){
this.$router.push({path:"/course/courseware/coursewareAdd",query:{}})
},
//
goback(){
this.$router.push({path:"/course/CourseList",query:{} })
},
//
del(record){
deleteCourseware({id:record.id}).then(res => {
if(res.code == 200) this.$refs.table.refresh(true);
});
},
//
courseQuestion(record){
console.log("哈哈");
this.$router.push({path :'/course/question/examQuestion',query:{id : record.id} });
}
},
}
</script>
</script>

View File

@ -4,15 +4,15 @@
<a-descriptions title="课程详情" layout="horizontal" bordered size="small" :column="1">
<a-descriptions-item label="课程编号"> {{ detailData.courseCode }} </a-descriptions-item>
<a-descriptions-item label="课程名称"> {{ detailData.courseName }} </a-descriptions-item>
<a-descriptions-item label="课程类别"> {{ detailData.courseName }} </a-descriptions-item>
<a-descriptions-item label="课程类别"> {{ detailData.courseType }} </a-descriptions-item>
<a-descriptions-item label="课时"> {{ detailData.hour }} </a-descriptions-item>
<a-descriptions-item label="试题数量"> {{ detailData.questionCount }} </a-descriptions-item>
<a-descriptions-item label="学习内容"> {{ detailData.courseName }} </a-descriptions-item>
<a-descriptions-item label="备注"> {{ detailData.courseName }} </a-descriptions-item>
<a-descriptions-item label="学习内容"> {{ detailData.learningContent }} </a-descriptions-item>
<a-descriptions-item label="备注"> {{ detailData.remark }} </a-descriptions-item>
</a-descriptions>
<div class="buttonGroup">
<a-button type="primary" @click="close"> 返回 </a-button>
<a-button type="primary"> 编辑 </a-button>
<a-button type="primary" @click="edit"> 编辑 </a-button>
</div>
</a-card>
</page-header-wrapper>
@ -36,6 +36,9 @@ export default {
methods: {
close () {
this.$router.push({ path: '/course/CourseList', query: { } });
},
edit(record) {
this.$router.push({ path : '/course/CourseAdd', query:{record}})
}
},

View File

@ -0,0 +1,3 @@
<h1>
hello World
</h1>