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

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> <template>
<a-card :bordered="false" title="系統新增"> <a-card :bordered="false" title="课程新增">
<template slot="extra"> <template slot="extra">
<a-button type="primary" @click="goback">返回</a-button> <a-button type="primary" @click="goback">返回</a-button>
<a-button type="primary" @click="save">保存</a-button> <a-button type="primary" @click="save">保存</a-button>
@ -193,7 +193,9 @@ export default {
// //
goback() { goback() {
console.log('this.$route.query.type',this.$route.query.type);
this.$router.push({ this.$router.push({
// /course/CourseList/sys
path: '/course/CourseList/'+this.$route.query.type, path: '/course/CourseList/'+this.$route.query.type,
query: { query: {
courseName: this.$route.query.courseName, courseName: this.$route.query.courseName,

View File

@ -54,7 +54,7 @@ export default {
}, },
methods: { methods: {
close() { close() {
this.$router.push({ path: '/course/CourseList', query: {} }) this.$router.push({ path: '/course/CourseList'+this.$route.query.type, query: {} })
}, },
edit(record) { edit(record) {
this.$router.push({ path: '/course/CourseAdd', query: { id: this.queryParam.id } }) this.$router.push({ path: '/course/CourseAdd', query: { id: this.queryParam.id } })

View File

@ -66,9 +66,11 @@ export default {
}, },
created() { created() {
this.dictionaryDropDown() this.dictionaryDropDown()
this.changeType()
}, },
watch: { watch: {
$route(to, from) { $route(to, from) {
// console.log('to',to);
//to from //to from
this.changeType(to.path) this.changeType(to.path)
this.$refs.table.refresh(true) this.$refs.table.refresh(true)
@ -94,10 +96,10 @@ export default {
this.$refs.table.refresh(true) this.$refs.table.refresh(true)
}, },
detail(record) { 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) { 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) { del(record) {
deleteCourse({ ids: record.id }).then((res) => { deleteCourse({ ids: record.id }).then((res) => {
@ -111,6 +113,7 @@ export default {
path: '/course/question/QuestionList', path: '/course/question/QuestionList',
query: { query: {
id: record.id, id: record.id,
type: this.queryParam.type,
courseName: this.queryParam.courseName, courseName: this.queryParam.courseName,
pageNum: this.$refs.table.localPagination.current, pageNum: this.$refs.table.localPagination.current,
}, },
@ -129,6 +132,7 @@ export default {
}, },
// //
changeType(path) { changeType(path) {
// console.log('type',path);
var arr = [] var arr = []
if (path) { if (path) {
arr = path.split('/') arr = path.split('/')
@ -137,6 +141,7 @@ export default {
} }
let str = arr[arr.length - 1] let str = arr[arr.length - 1]
this.queryParam.type = str 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') // str === 'sys' ? (this.power.add = 'project:sys:add') : (this.power.add = 'project:add')

View File

@ -19,12 +19,12 @@
<a-divider type="vertical" /> <a-divider type="vertical" />
<a href="javascript:;" @click="courseQuestion(record)">抽考题</a> <a href="javascript:;" @click="courseQuestion(record)">抽考题</a>
</template> </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> <a href="javascript:;" @click="openDrawer(record)">预览</a>
</template> </template>
</s-table> </s-table>
<a-drawer title="课件预览" :destroyOnClose="true" placement="right" width="1200" :closable="true" :visible="coursewareVisible" @close="() => this.coursewareVisible = false"> <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-drawer>
</a-card> </a-card>
</template> </template>
@ -34,7 +34,6 @@ import { getCoursewareListByCourseId } from '@/api/course/course'
import { deleteCourseware } from '@/api/course/courseware' import { deleteCourseware } from '@/api/course/courseware'
import CoursewarePreview from './CoursewarePreview.vue' import CoursewarePreview from './CoursewarePreview.vue'
export default { export default {
components: { components: {
STable, STable,
@ -44,10 +43,9 @@ export default {
props: { props: {
courseId: { courseId: {
type: Number, type: Number,
} },
},
watch: {
}, },
watch: {},
data() { data() {
return { return {
selectCoursewareId: '', selectCoursewareId: '',
@ -74,23 +72,29 @@ export default {
} }
}, },
methods: { methods: {
openDrawer(record){ openDrawer(record) {
this.coursewareVisible = true; this.coursewareVisible = true
this.selectCoursewareId = record.id; this.selectCoursewareId = record.id
}, },
// //
coursewareAdd() { 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) { 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() { goback() {
this.$router.push({ path: '/course/CourseList', query: {} }) this.$router.push({ path: '/course/CourseList'+this.$route.query.type, query: {} })
}, },
// //