课件操作栏操作按钮未显示的问题

This commit is contained in:
18571350067 2021-12-28 19:55:20 +08:00
parent 4200f1b952
commit 534897baa4
4 changed files with 27 additions and 16 deletions

View File

@ -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,

View File

@ -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 } })

View File

@ -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')

View File

@ -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: {} })
},
//