课件操作栏操作按钮未显示的问题
This commit is contained in:
parent
4200f1b952
commit
534897baa4
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<a-card :bordered="false" title="系統新增">
|
||||
<a-card :bordered="false" title="课程新增">
|
||||
<template slot="extra">
|
||||
<a-button type="primary" @click="goback">返回</a-button>
|
||||
<a-button type="primary" @click="save">保存</a-button>
|
||||
|
@ -193,7 +193,9 @@ export default {
|
|||
|
||||
//返回
|
||||
goback() {
|
||||
console.log('this.$route.query.type',this.$route.query.type);
|
||||
this.$router.push({
|
||||
// /course/CourseList/sys
|
||||
path: '/course/CourseList/'+this.$route.query.type,
|
||||
query: {
|
||||
courseName: this.$route.query.courseName,
|
||||
|
|
|
@ -54,7 +54,7 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
close() {
|
||||
this.$router.push({ path: '/course/CourseList', query: {} })
|
||||
this.$router.push({ path: '/course/CourseList'+this.$route.query.type, query: {} })
|
||||
},
|
||||
edit(record) {
|
||||
this.$router.push({ path: '/course/CourseAdd', query: { id: this.queryParam.id } })
|
||||
|
|
|
@ -66,9 +66,11 @@ export default {
|
|||
},
|
||||
created() {
|
||||
this.dictionaryDropDown()
|
||||
this.changeType()
|
||||
},
|
||||
watch: {
|
||||
$route(to, from) {
|
||||
// console.log('to',to);
|
||||
//to是前往的路由 from是去往的路由 同一个组件只会渲染一次
|
||||
this.changeType(to.path)
|
||||
this.$refs.table.refresh(true)
|
||||
|
@ -94,10 +96,10 @@ export default {
|
|||
this.$refs.table.refresh(true)
|
||||
},
|
||||
detail(record) {
|
||||
this.$router.push({ path: '/course/CourseDetail', query: { id: record.id } })
|
||||
this.$router.push({ path: '/course/CourseDetail', query: { id: record.id, type: this.queryParam.type } })
|
||||
},
|
||||
courseWare(record) {
|
||||
this.$router.push({ path: '/course/CoursewareList', query: { id: record.id } })
|
||||
this.$router.push({ path: '/course/CoursewareList', query: { id: record.id, type: this.queryParam.type } })
|
||||
},
|
||||
del(record) {
|
||||
deleteCourse({ ids: record.id }).then((res) => {
|
||||
|
@ -111,6 +113,7 @@ export default {
|
|||
path: '/course/question/QuestionList',
|
||||
query: {
|
||||
id: record.id,
|
||||
type: this.queryParam.type,
|
||||
courseName: this.queryParam.courseName,
|
||||
pageNum: this.$refs.table.localPagination.current,
|
||||
},
|
||||
|
@ -129,6 +132,7 @@ export default {
|
|||
},
|
||||
//变更类型
|
||||
changeType(path) {
|
||||
// console.log('type',path);
|
||||
var arr = []
|
||||
if (path) {
|
||||
arr = path.split('/')
|
||||
|
@ -137,6 +141,7 @@ export default {
|
|||
}
|
||||
let str = arr[arr.length - 1]
|
||||
this.queryParam.type = str
|
||||
// console.log('this.queryParam.type',this.queryParam.type);
|
||||
|
||||
//权限
|
||||
// str === 'sys' ? (this.power.add = 'project:sys:add') : (this.power.add = 'project:add')
|
||||
|
|
|
@ -19,12 +19,12 @@
|
|||
<a-divider type="vertical" />
|
||||
<a href="javascript:;" @click="courseQuestion(record)">抽考题</a>
|
||||
</template>
|
||||
<template v-if="courseId" slot="action" slot-scope="text, record">
|
||||
<template v-else slot="action" slot-scope="text, record">
|
||||
<a href="javascript:;" @click="openDrawer(record)">预览</a>
|
||||
</template>
|
||||
</s-table>
|
||||
<a-drawer title="课件预览" :destroyOnClose="true" placement="right" width="1200" :closable="true" :visible="coursewareVisible" @close="() => this.coursewareVisible = false">
|
||||
<courseware-preview :coursewareId="selectCoursewareId"/>
|
||||
<courseware-preview :coursewareId="selectCoursewareId" />
|
||||
</a-drawer>
|
||||
</a-card>
|
||||
</template>
|
||||
|
@ -34,7 +34,6 @@ import { getCoursewareListByCourseId } from '@/api/course/course'
|
|||
import { deleteCourseware } from '@/api/course/courseware'
|
||||
import CoursewarePreview from './CoursewarePreview.vue'
|
||||
|
||||
|
||||
export default {
|
||||
components: {
|
||||
STable,
|
||||
|
@ -44,10 +43,9 @@ export default {
|
|||
props: {
|
||||
courseId: {
|
||||
type: Number,
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
},
|
||||
watch: {},
|
||||
data() {
|
||||
return {
|
||||
selectCoursewareId: '',
|
||||
|
@ -74,23 +72,29 @@ export default {
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
openDrawer(record){
|
||||
this.coursewareVisible = true;
|
||||
this.selectCoursewareId = record.id;
|
||||
openDrawer(record) {
|
||||
this.coursewareVisible = true
|
||||
this.selectCoursewareId = record.id
|
||||
},
|
||||
//新增课件
|
||||
coursewareAdd() {
|
||||
this.$router.push({ path: '/course/CoursewareAddOrUpdate', query: { courseId: this.$route.query.id, ifResources: 0 } })
|
||||
this.$router.push({
|
||||
path: '/course/CoursewareAddOrUpdate',
|
||||
query: { courseId: this.$route.query.id, isResources: 0 },
|
||||
})
|
||||
},
|
||||
|
||||
//编辑
|
||||
edit(record) {
|
||||
this.$router.push({ path: '/course/CoursewareAddOrUpdate', query: { coursewareId: record.id, courseId: this.$route.query.id, type: record.type } })
|
||||
this.$router.push({
|
||||
path: '/course/CoursewareAddOrUpdate',
|
||||
query: { coursewareId: record.id, courseId: this.$route.query.id, type: record.type },
|
||||
})
|
||||
},
|
||||
|
||||
//返回
|
||||
goback() {
|
||||
this.$router.push({ path: '/course/CourseList', query: {} })
|
||||
this.$router.push({ path: '/course/CourseList'+this.$route.query.type, query: {} })
|
||||
},
|
||||
|
||||
// 刪除課件
|
||||
|
|
Loading…
Reference in New Issue