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

updates

上级 f5572f81
......@@ -42,6 +42,7 @@ const listOptions = $computed(() => {
{ type: 'selection' },
{ label: '序号', type: 'index', align: 'center' },
{ 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: 'elective_type_name', align: 'center' },
{ label: '课程分类', prop: 'classification_name', align: 'center', width: '310' },
......
<script lang="ts" setup>
import { checkPermission } from '@/utils/permission'
import { ElMessage, ElMessageBox } from 'element-plus'
import AddSemCourse from './AddSemCourse.vue'
import { getSemCourse, relationSemCourse, setAliasName } from '../api'
......@@ -110,7 +111,11 @@ const handleChangeName = (row: any) => {
<AppList v-bind="listOptions" ref="appList" border stripe style="margin-top: 30px">
<el-button type="primary" round @click="handleAddCourse">添加课程</el-button>
<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 #table-operate="{ row }">
<el-space>
......
......@@ -67,7 +67,7 @@ const handlePrimary = () => {
<template>
<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">
<template #table-avatar="{ row }">
<img
......
<script setup lang="ts">
import { checkPermission } from '@/utils/permission'
import { ElMessage } from 'element-plus'
import { setDownload } from '../../api'
import AddVideoDialog from '../stepTwoComponents/AddVideoDialog.vue'
......@@ -116,6 +118,7 @@ const handleChangeStatus = (row: any) => {
inline-prompt
style="--el-switch-on-color: #aa1941"
@change="handleChangeStatus(row)"
:disabled="!checkPermission('v1-course-set-course-information-can-download')"
></el-switch>
</template>
<template #table-operate="{ row }">
......
......@@ -68,7 +68,9 @@ const handlePrimary = () => {
<template>
<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">
<template #table-avatar="{ row }">
<img :src="row.avatar" style="width: 50px; height: 50px; display: block; margin: 0 auto" />
......
......@@ -84,7 +84,9 @@ const handlePrimary = () => {
<template>
<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">
<template #table-avatar="{ row }">
<img :src="row.avatar" style="width: 50px; height: 50px; display: block; margin: 0 auto" />
......
......@@ -237,7 +237,7 @@ const handleInformation = (val: any) => {
<el-input v-model="form.credit" maxlength="3" />
</el-form-item>
<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" -->
<el-option
......
<script lang="ts" setup>
import { checkPermission } from '@/utils/permission'
import { Plus } from '@element-plus/icons-vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { getCharacter, delCharacter, getVideoDetails, dragChapterList, createCharacter, editCharacter } from '../api'
......@@ -66,7 +68,7 @@ const defaultProps = {
// 获取章节列表
onMounted(() => {
handleChapterList()
checkPermission('v1-course-chapters') && handleChapterList()
})
const handleChapterList = () => {
getCharacter({ course_id: id, type: 'tree' }).then((res: any) => {
......@@ -135,14 +137,13 @@ const handleAddDialog = (node: any, item: any) => {
flag.value = true
defaultExpandedKeys.value = [node.key]
if (item.resource_type === '6') {
if (item.resource_type === '6' && checkPermission('v1-course-search-live')) {
isShowLiveDialog.value = true
} else if (
item.resource_type === '2' ||
item.resource_type === '10' ||
item.resource_type === '11' ||
item.resource_type === '4'
(item.resource_type === '2' && checkPermission('v1-course-search-video')) ||
(item.resource_type === '10' && checkPermission('v1-course-search-courseware')) ||
(item.resource_type === '11' && checkPermission('v1-course-search-lesson-plan')) ||
(item.resource_type === '4' && checkPermission('v1-course-search-other-information'))
) {
isShowAddDialog.value = true
} else if (item.resource_type === '3' || item.resource_type === '9') {
......@@ -178,6 +179,7 @@ const allowDrop = (draggingNode: any, dropNode: any, type: any) => {
}
//拖拽列表
const handleDrop = (startNode: any, endNode: any, position: any) => {
if (!checkPermission('v1-course-drag')) {
const params = {
course_id: id,
id: startNode.data.id,
......@@ -187,6 +189,7 @@ const handleDrop = (startNode: any, endNode: any, position: any) => {
dragChapterList(params).then(() => {
handleChapterList()
})
}
}
const imgUrl = (node: any) => {
if (node.data.resource_type === '1') {
......@@ -293,7 +296,6 @@ const handleChangeStatus = (node: any, data: any) => {
ElMessage.success('设置下载控制成功')
})
} else {
const params: any = {
course_id: id,
id: data.id,
......@@ -310,7 +312,14 @@ const handleChangeStatus = (node: any, data: any) => {
<template>
<AppCard :title="isEditCourse === '1' ? '编辑课程' : '新建课程'">
<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>
......@@ -360,10 +369,21 @@ const handleChangeStatus = (node: any, data: any) => {
>下载</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 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>
......@@ -371,6 +391,7 @@ const handleChangeStatus = (node: any, data: any) => {
class="btn_operate"
v-if="data.depth === '1' || data.depth === '2'"
@click="handleOpenRules(node, data)"
v-permission="'v1-course-set-chapter-rules'"
>
<el-icon><Plus /></el-icon>
&nbsp; 开放规则
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论