| | |
| | | :visible.sync="dialogVisible" |
| | | :modal-append-to-body="false" |
| | | :close-on-click-modal="false" |
| | | width="600px" |
| | | width="50%" |
| | | :before-close="handleClose" |
| | | > |
| | | <div style="margin: 0 25px"> |
| | |
| | | |
| | | <!-- </div>--> |
| | | <div style="display: flex;flex-direction: column"> |
| | | <span style="font-size: 20px;font-weight: 550">课程章节资源</span> |
| | | <span style="font-size: 20px;font-weight: 550">课程内容</span> |
| | | <el-table |
| | | border |
| | | :data="courseTable" |
| | |
| | | <el-table-column |
| | | prop="chapterName" |
| | | label="小节名称" align="center"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="teacher" |
| | | label="讲师" align="center"> |
| | | <template #default="scope"> |
| | | <span>{{scope.row.teacher ? scope.row.teacher : '--'}}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="资源类别" |
| | |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | <span slot="footer" class="dialog-footer" v-if="showBtn"> |
| | | <el-button type="primary" @click="examine('pass')">审核通过</el-button> |
| | | <el-button type="warning" @click="examine('reject')">审核驳回</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script > |
| | | import { checkCourse, listCourse } from '@/api/onlineEducation/course' |
| | | |
| | | export default { |
| | | name: 'addUser', |
| | | components: { |
| | |
| | | dialogStatus: '', |
| | | dataForm: {}, |
| | | courseTable: [], |
| | | courseList: [] |
| | | courseList: [], |
| | | showBtn:false |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | methods: { |
| | | openDialog (data,type) { |
| | | openDialog (data,type,courseType) { |
| | | this.dialogVisible = true; |
| | | |
| | | this.dataForm = data; |
| | | console.log('dataForm ',this.dataForm ) |
| | | if(type === 'course'){ |
| | | this.courseList = data.outline |
| | | this.courseTable = this.recursion(data.outline,type) |
| | | |
| | | if(courseType == 'check'){ |
| | | this.showBtn = true |
| | | console.log('this.showBtn ',this.showBtn ) |
| | | } |
| | | }else { |
| | | console.log('courseT2222222222able',data.chapterList) |
| | | this.courseList = data.chapterList |
| | | this.courseTable = this.recursion(data.chapterList,type) |
| | | } |
| | | |
| | | console.log('courseT2222222222able',this.courseTable) |
| | | console.log('coursee',this.courseTable) |
| | | }, |
| | | recursion (data,type) { |
| | | let tmp = [] |
| | |
| | | resourceType: child.haveResource == 0 ? '视频' : '音频' , |
| | | lessonNum: child.lessonNum, |
| | | url: child.url, |
| | | children: this.recursion(child.children) |
| | | children: this.recursion(child.children), |
| | | teacher: child.teacher |
| | | }) |
| | | }) |
| | | }else { |
| | |
| | | resourceType: child.haveResource == 0 ? '视频' : '音频' , |
| | | lessonNum: child.lessonNum, |
| | | url: child.url, |
| | | children: this.recursion(child.children) |
| | | children: this.recursion(child.children), |
| | | teacher: child.teacher |
| | | }) |
| | | }) |
| | | } |
| | |
| | | this.isClose = !this.isClose |
| | | }, |
| | | handleClose() { |
| | | this.showBtn = false |
| | | this.dialogVisible = false; |
| | | this.$emit("getList"); |
| | | }, |
| | | onSubmit() { |
| | | this.$emit("getList"); |
| | | this.dialogVisible = false; |
| | | this.$emit("getList"); |
| | | this.dialogVisible = false; |
| | | }, |
| | | examine(type){ |
| | | let msg = ''; |
| | | const param = { |
| | | id: this.dataForm.id, |
| | | status: null |
| | | } |
| | | if(type === 'pass'){ |
| | | param.status = 2 |
| | | msg = '审核通过' |
| | | }else { |
| | | param.status = 3 |
| | | msg = '审核驳回' |
| | | } |
| | | this.$confirm(`确定${msg}该条数据?`, '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(async () => { |
| | | checkCourse(param).then((res) => { |
| | | if (res.code == 200) { |
| | | this.$message({ |
| | | message: '成功', |
| | | type: 'success' |
| | | }) |
| | | this.handleClose() |
| | | }else { |
| | | this.$message({ |
| | | message: res.msg, |
| | | type: 'warning' |
| | | }) |
| | | } |
| | | }) |
| | | }) |
| | | }, |
| | | objectSpanMethod({ row, column, rowIndex, columnIndex }) { |
| | | if(columnIndex === 0) { |
| | |
| | | .open{ |
| | | height: 15px; |
| | | } |
| | | .dialog-footer{ |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-around; |
| | | } |
| | | </style> |