|
@@ -3,9 +3,6 @@
|
|
<div class="school-container">
|
|
<div class="school-container">
|
|
<div class="topic">
|
|
<div class="topic">
|
|
<el-form :inline="true" :model="formInline" class="demo-form-inline">
|
|
<el-form :inline="true" :model="formInline" class="demo-form-inline">
|
|
- <el-form-item label="课程id">
|
|
|
|
- <el-input v-model="formInline.courseId" placeholder="courseId" clearable />
|
|
|
|
- </el-form-item>
|
|
|
|
<el-form-item label="code">
|
|
<el-form-item label="code">
|
|
<el-input v-model="formInline.code" placeholder="code" clearable />
|
|
<el-input v-model="formInline.code" placeholder="code" clearable />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -46,6 +43,14 @@
|
|
prop="playUrl"
|
|
prop="playUrl"
|
|
/>
|
|
/>
|
|
<el-table-column
|
|
<el-table-column
|
|
|
|
+ label="状态"
|
|
|
|
+ width="100"
|
|
|
|
+ >
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <span style="margin-left: 10px">{{ scope.row.status === 'NOT_ON_STOCK' ? '未上架' : '已上架' }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column
|
|
label="免费"
|
|
label="免费"
|
|
width="60"
|
|
width="60"
|
|
>
|
|
>
|
|
@@ -73,12 +78,10 @@
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="操作">
|
|
<el-table-column label="操作">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <!--
|
|
|
|
<el-button
|
|
<el-button
|
|
size="mini"
|
|
size="mini"
|
|
@click="handleDel(scope.$index, scope.row)"
|
|
@click="handleDel(scope.$index, scope.row)"
|
|
>{{ scope.row.status === 'NOT_ON_STOCK' ? '上架' : '下架' }}</el-button>
|
|
>{{ scope.row.status === 'NOT_ON_STOCK' ? '上架' : '下架' }}</el-button>
|
|
- -->
|
|
|
|
<el-button
|
|
<el-button
|
|
size="mini"
|
|
size="mini"
|
|
@click="handleSet(scope.$index, scope.row)"
|
|
@click="handleSet(scope.$index, scope.row)"
|
|
@@ -88,9 +91,6 @@
|
|
</el-table>
|
|
</el-table>
|
|
<el-dialog title="课件" :visible.sync="dialogFormVisible">
|
|
<el-dialog title="课件" :visible.sync="dialogFormVisible">
|
|
<el-form ref="ruleForm" :model="form" :rules="rules">
|
|
<el-form ref="ruleForm" :model="form" :rules="rules">
|
|
- <el-form-item label="课程Id" :label-width="formLabelWidth" prop="courseId">
|
|
|
|
- <el-input v-model="form.courseId" autocomplete="off" clearable />
|
|
|
|
- </el-form-item>
|
|
|
|
<el-form-item label="code" :label-width="formLabelWidth" prop="code">
|
|
<el-form-item label="code" :label-width="formLabelWidth" prop="code">
|
|
<el-input v-model="form.code" autocomplete="off" clearable />
|
|
<el-input v-model="form.code" autocomplete="off" clearable />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -133,14 +133,13 @@ export default {
|
|
return {
|
|
return {
|
|
dialogFormVisible: false,
|
|
dialogFormVisible: false,
|
|
formInline: {
|
|
formInline: {
|
|
- courseId: '',
|
|
|
|
|
|
+ courseId: this.$route.query.id,
|
|
code: '',
|
|
code: '',
|
|
title: ''
|
|
title: ''
|
|
},
|
|
},
|
|
form: {},
|
|
form: {},
|
|
formLabelWidth: '120px',
|
|
formLabelWidth: '120px',
|
|
rules: {
|
|
rules: {
|
|
- courseId: [{ required: true, message: '请输入课程id', trigger: 'blur' }],
|
|
|
|
code: [{ required: true, message: '请输入code', trigger: 'blur' }],
|
|
code: [{ required: true, message: '请输入code', trigger: 'blur' }],
|
|
title: [{ required: true, message: '请输入名称', trigger: 'blur' }],
|
|
title: [{ required: true, message: '请输入名称', trigger: 'blur' }],
|
|
free: [{ required: true, message: '请选择状态', trigger: 'change' }],
|
|
free: [{ required: true, message: '请选择状态', trigger: 'change' }],
|
|
@@ -153,6 +152,7 @@ export default {
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
this.$store.dispatch('courseWareList/getCourseWareLists', {
|
|
this.$store.dispatch('courseWareList/getCourseWareLists', {
|
|
|
|
+ courseId: this.$route.query.id,
|
|
page: this.page
|
|
page: this.page
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -172,11 +172,12 @@ export default {
|
|
handleDel(index, row) {
|
|
handleDel(index, row) {
|
|
const id = row.id
|
|
const id = row.id
|
|
const status = row.status === 'NOT_ON_STOCK' ? 'HAS_ON_STOCK' : 'NOT_ON_STOCK'
|
|
const status = row.status === 'NOT_ON_STOCK' ? 'HAS_ON_STOCK' : 'NOT_ON_STOCK'
|
|
- this.$store.dispatch('courseList/setCourseLists', {
|
|
|
|
|
|
+ this.$store.dispatch('courseWareList/setCourseWareLists', {
|
|
id,
|
|
id,
|
|
status
|
|
status
|
|
}).then(() => {
|
|
}).then(() => {
|
|
this.$store.dispatch('courseWareList/getCourseWareLists', {
|
|
this.$store.dispatch('courseWareList/getCourseWareLists', {
|
|
|
|
+ courseId: this.$route.query.id,
|
|
page: this.page
|
|
page: this.page
|
|
})
|
|
})
|
|
})
|
|
})
|
|
@@ -203,6 +204,7 @@ export default {
|
|
this.$store.dispatch('courseWareList/addCourseWareLists', this.form).then(() => {
|
|
this.$store.dispatch('courseWareList/addCourseWareLists', this.form).then(() => {
|
|
this.dialogFormVisible = false
|
|
this.dialogFormVisible = false
|
|
this.$store.dispatch('courseWareList/getCourseWareLists', {
|
|
this.$store.dispatch('courseWareList/getCourseWareLists', {
|
|
|
|
+ courseId: this.$route.query.id,
|
|
page: this.page
|
|
page: this.page
|
|
})
|
|
})
|
|
})
|
|
})
|
|
@@ -210,6 +212,7 @@ export default {
|
|
this.$store.dispatch('courseWareList/setCourseWareLists', this.form).then(() => {
|
|
this.$store.dispatch('courseWareList/setCourseWareLists', this.form).then(() => {
|
|
this.dialogFormVisible = false
|
|
this.dialogFormVisible = false
|
|
this.$store.dispatch('courseWareList/getCourseWareLists', {
|
|
this.$store.dispatch('courseWareList/getCourseWareLists', {
|
|
|
|
+ courseId: this.$route.query.id,
|
|
page: this.page
|
|
page: this.page
|
|
})
|
|
})
|
|
})
|
|
})
|
|
@@ -224,7 +227,7 @@ export default {
|
|
this.dialogFormVisible = true
|
|
this.dialogFormVisible = true
|
|
this.type = 'add'
|
|
this.type = 'add'
|
|
this.form = {
|
|
this.form = {
|
|
- courseId: '',
|
|
|
|
|
|
+ courseId: this.$route.query.id,
|
|
code: '',
|
|
code: '',
|
|
title: '',
|
|
title: '',
|
|
playUrl: '',
|
|
playUrl: '',
|
|
@@ -236,6 +239,7 @@ export default {
|
|
console.log(val)
|
|
console.log(val)
|
|
this.page = val
|
|
this.page = val
|
|
this.$store.dispatch('courseWareList/getCourseWareLists', {
|
|
this.$store.dispatch('courseWareList/getCourseWareLists', {
|
|
|
|
+ courseId: this.$route.query.id,
|
|
page: this.page
|
|
page: this.page
|
|
})
|
|
})
|
|
}
|
|
}
|