提交 229361e3 authored 作者: matian's avatar matian

updates

上级 f5572f81
...@@ -42,6 +42,7 @@ const listOptions = $computed(() => { ...@@ -42,6 +42,7 @@ const listOptions = $computed(() => {
{ type: 'selection' }, { type: 'selection' },
{ label: '序号', type: 'index', align: 'center' }, { label: '序号', type: 'index', align: 'center' },
{ label: '课程名称', prop: 'name', align: 'center', width: '200' }, { label: '课程名称', prop: 'name', align: 'center', width: '200' },
{ label: '所属机构', prop: 'organ_id_name', align: 'center', width: '200' },
{ label: '课程类型', prop: 'online_type_name', align: 'center', width: '200' }, { label: '课程类型', prop: 'online_type_name', align: 'center', width: '200' },
{ label: '选课类型', prop: 'elective_type_name', align: 'center' }, { label: '选课类型', prop: 'elective_type_name', align: 'center' },
{ label: '课程分类', prop: 'classification_name', align: 'center', width: '310' }, { label: '课程分类', prop: 'classification_name', align: 'center', width: '310' },
......
<script lang="ts" setup> <script lang="ts" setup>
import { checkPermission } from '@/utils/permission'
import { ElMessage, ElMessageBox } from 'element-plus' import { ElMessage, ElMessageBox } from 'element-plus'
import AddSemCourse from './AddSemCourse.vue' import AddSemCourse from './AddSemCourse.vue'
import { getSemCourse, relationSemCourse, setAliasName } from '../api' import { getSemCourse, relationSemCourse, setAliasName } from '../api'
...@@ -110,7 +111,11 @@ const handleChangeName = (row: any) => { ...@@ -110,7 +111,11 @@ const handleChangeName = (row: any) => {
<AppList v-bind="listOptions" ref="appList" border stripe style="margin-top: 30px"> <AppList v-bind="listOptions" ref="appList" border stripe style="margin-top: 30px">
<el-button type="primary" round @click="handleAddCourse">添加课程</el-button> <el-button type="primary" round @click="handleAddCourse">添加课程</el-button>
<template #alias_name="{ row }"> <template #alias_name="{ row }">
<el-input v-model="row.alias_name" @blur="handleChangeName(row)"></el-input> <el-input
v-model="row.alias_name"
@blur="handleChangeName(row)"
:disabled="!checkPermission('v1-learning-semester-set-course-alias-name')"
></el-input>
</template> </template>
<template #table-operate="{ row }"> <template #table-operate="{ row }">
<el-space> <el-space>
......
...@@ -67,7 +67,7 @@ const handlePrimary = () => { ...@@ -67,7 +67,7 @@ const handlePrimary = () => {
<template> <template>
<div> <div>
<el-button type="primary" @click="dialogVisible = true">添加助教</el-button> <el-button type="primary" @click="dialogVisible = true" v-permission="'v1-course-search-teacher'">添加助教</el-button>
<AppList v-bind="listOptions" ref="appList"> <AppList v-bind="listOptions" ref="appList">
<template #table-avatar="{ row }"> <template #table-avatar="{ row }">
<img <img
......
<script setup lang="ts"> <script setup lang="ts">
import { checkPermission } from '@/utils/permission'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import { setDownload } from '../../api' import { setDownload } from '../../api'
import AddVideoDialog from '../stepTwoComponents/AddVideoDialog.vue' import AddVideoDialog from '../stepTwoComponents/AddVideoDialog.vue'
...@@ -116,6 +118,7 @@ const handleChangeStatus = (row: any) => { ...@@ -116,6 +118,7 @@ const handleChangeStatus = (row: any) => {
inline-prompt inline-prompt
style="--el-switch-on-color: #aa1941" style="--el-switch-on-color: #aa1941"
@change="handleChangeStatus(row)" @change="handleChangeStatus(row)"
:disabled="!checkPermission('v1-course-set-course-information-can-download')"
></el-switch> ></el-switch>
</template> </template>
<template #table-operate="{ row }"> <template #table-operate="{ row }">
......
...@@ -68,7 +68,9 @@ const handlePrimary = () => { ...@@ -68,7 +68,9 @@ const handlePrimary = () => {
<template> <template>
<div> <div>
<el-button type="primary" @click="dialogVisible = true">添加讲师</el-button> <el-button type="primary" @click="dialogVisible = true" v-permission="'v1-course-search-lecturer'"
>添加讲师</el-button
>
<AppList v-bind="listOptions" ref="appList"> <AppList v-bind="listOptions" ref="appList">
<template #table-avatar="{ row }"> <template #table-avatar="{ row }">
<img :src="row.avatar" style="width: 50px; height: 50px; display: block; margin: 0 auto" /> <img :src="row.avatar" style="width: 50px; height: 50px; display: block; margin: 0 auto" />
......
...@@ -84,7 +84,9 @@ const handlePrimary = () => { ...@@ -84,7 +84,9 @@ const handlePrimary = () => {
<template> <template>
<div> <div>
<el-button type="primary" @click="dialogVisible = true">添加周期性直播</el-button> <el-button type="primary" @click="dialogVisible = true" v-permission="'v1-course-search-live'"
>添加周期性直播</el-button
>
<AppList v-bind="listOptions" ref="appList"> <AppList v-bind="listOptions" ref="appList">
<template #table-avatar="{ row }"> <template #table-avatar="{ row }">
<img :src="row.avatar" style="width: 50px; height: 50px; display: block; margin: 0 auto" /> <img :src="row.avatar" style="width: 50px; height: 50px; display: block; margin: 0 auto" />
......
...@@ -237,7 +237,7 @@ const handleInformation = (val: any) => { ...@@ -237,7 +237,7 @@ const handleInformation = (val: any) => {
<el-input v-model="form.credit" maxlength="3" /> <el-input v-model="form.credit" maxlength="3" />
</el-form-item> </el-form-item>
<el-form-item label="适用专业" prop="specialty_id"> <el-form-item label="适用专业" prop="specialty_id">
<el-select v-model="form.specialty_id" placeholder="请选择适用专业" style="width: 100%" clearable multiple> <el-select v-model="form.specialty_id" placeholder="请选择适用专业" style="width: 100%" clearable multiple v-permission="'v1-course-search-specialty'">
<!-- :remote-method="handleMajorList" --> <!-- :remote-method="handleMajorList" -->
<el-option <el-option
......
<script lang="ts" setup> <script lang="ts" setup>
import { checkPermission } from '@/utils/permission'
import { Plus } from '@element-plus/icons-vue' import { Plus } from '@element-plus/icons-vue'
import { ElMessage, ElMessageBox } from 'element-plus' import { ElMessage, ElMessageBox } from 'element-plus'
import { getCharacter, delCharacter, getVideoDetails, dragChapterList, createCharacter, editCharacter } from '../api' import { getCharacter, delCharacter, getVideoDetails, dragChapterList, createCharacter, editCharacter } from '../api'
...@@ -66,7 +68,7 @@ const defaultProps = { ...@@ -66,7 +68,7 @@ const defaultProps = {
// 获取章节列表 // 获取章节列表
onMounted(() => { onMounted(() => {
handleChapterList() checkPermission('v1-course-chapters') && handleChapterList()
}) })
const handleChapterList = () => { const handleChapterList = () => {
getCharacter({ course_id: id, type: 'tree' }).then((res: any) => { getCharacter({ course_id: id, type: 'tree' }).then((res: any) => {
...@@ -135,14 +137,13 @@ const handleAddDialog = (node: any, item: any) => { ...@@ -135,14 +137,13 @@ const handleAddDialog = (node: any, item: any) => {
flag.value = true flag.value = true
defaultExpandedKeys.value = [node.key] defaultExpandedKeys.value = [node.key]
if (item.resource_type === '6' && checkPermission('v1-course-search-live')) {
if (item.resource_type === '6') {
isShowLiveDialog.value = true isShowLiveDialog.value = true
} else if ( } else if (
item.resource_type === '2' || (item.resource_type === '2' && checkPermission('v1-course-search-video')) ||
item.resource_type === '10' || (item.resource_type === '10' && checkPermission('v1-course-search-courseware')) ||
item.resource_type === '11' || (item.resource_type === '11' && checkPermission('v1-course-search-lesson-plan')) ||
item.resource_type === '4' (item.resource_type === '4' && checkPermission('v1-course-search-other-information'))
) { ) {
isShowAddDialog.value = true isShowAddDialog.value = true
} else if (item.resource_type === '3' || item.resource_type === '9') { } else if (item.resource_type === '3' || item.resource_type === '9') {
...@@ -178,15 +179,17 @@ const allowDrop = (draggingNode: any, dropNode: any, type: any) => { ...@@ -178,15 +179,17 @@ const allowDrop = (draggingNode: any, dropNode: any, type: any) => {
} }
//拖拽列表 //拖拽列表
const handleDrop = (startNode: any, endNode: any, position: any) => { const handleDrop = (startNode: any, endNode: any, position: any) => {
const params = { if (!checkPermission('v1-course-drag')) {
course_id: id, const params = {
id: startNode.data.id, course_id: id,
brother_id: endNode.data.id, id: startNode.data.id,
type: position brother_id: endNode.data.id,
type: position
}
dragChapterList(params).then(() => {
handleChapterList()
})
} }
dragChapterList(params).then(() => {
handleChapterList()
})
} }
const imgUrl = (node: any) => { const imgUrl = (node: any) => {
if (node.data.resource_type === '1') { if (node.data.resource_type === '1') {
...@@ -293,7 +296,6 @@ const handleChangeStatus = (node: any, data: any) => { ...@@ -293,7 +296,6 @@ const handleChangeStatus = (node: any, data: any) => {
ElMessage.success('设置下载控制成功') ElMessage.success('设置下载控制成功')
}) })
} else { } else {
const params: any = { const params: any = {
course_id: id, course_id: id,
id: data.id, id: data.id,
...@@ -310,7 +312,14 @@ const handleChangeStatus = (node: any, data: any) => { ...@@ -310,7 +312,14 @@ const handleChangeStatus = (node: any, data: any) => {
<template> <template>
<AppCard :title="isEditCourse === '1' ? '编辑课程' : '新建课程'"> <AppCard :title="isEditCourse === '1' ? '编辑课程' : '新建课程'">
<el-row> <el-row>
<el-button type="primary" round style="margin-bottom: 20px" @click="handleAddChapter">添加章</el-button> <el-button
type="primary"
round
style="margin-bottom: 20px"
@click="handleAddChapter"
v-permission="'v1-course-create-chapter'"
>添加章</el-button
>
<div class="course_tip"> <div class="course_tip">
温馨提示:先建“章”,后建“小节”;课程资源关联到小节;能够关联的资源包含:视频、作业、考试、直播、其他资料、教案、课件。 温馨提示:先建“章”,后建“小节”;课程资源关联到小节;能够关联的资源包含:视频、作业、考试、直播、其他资料、教案、课件。
</div> </div>
...@@ -360,10 +369,21 @@ const handleChangeStatus = (node: any, data: any) => { ...@@ -360,10 +369,21 @@ const handleChangeStatus = (node: any, data: any) => {
>下载</el-link >下载</el-link
> >
<el-link class="btn_edit" v-if="data.depth !== '3'" @click="handleEdit(node)" style="margin-left: 35px" <el-link
class="btn_edit"
v-if="data.depth !== '3'"
@click="handleEdit(node)"
style="margin-left: 35px"
v-permission="'v1-course-update-chapter'"
>编辑</el-link >编辑</el-link
> >
<el-link type="info" @click="handleDel(node)" style="margin-left: 25px">删除</el-link></span <el-link
type="info"
@click="handleDel(node)"
style="margin-left: 25px"
v-permission="'v1-course-delete-chapter'"
>删除</el-link
></span
> >
<span> <span>
...@@ -371,6 +391,7 @@ const handleChangeStatus = (node: any, data: any) => { ...@@ -371,6 +391,7 @@ const handleChangeStatus = (node: any, data: any) => {
class="btn_operate" class="btn_operate"
v-if="data.depth === '1' || data.depth === '2'" v-if="data.depth === '1' || data.depth === '2'"
@click="handleOpenRules(node, data)" @click="handleOpenRules(node, data)"
v-permission="'v1-course-set-chapter-rules'"
> >
<el-icon><Plus /></el-icon> <el-icon><Plus /></el-icon>
&nbsp; 开放规则 &nbsp; 开放规则
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论