dev_202412
yujialong 1 month ago
parent 38cbb4bdaa
commit 27fa0a1b22
  1. 24
      src/layouts/sidebar/index.vue
  2. 22
      src/pages/lesson/content/index.vue
  3. 12
      src/pages/lesson/list/index.vue
  4. 30
      src/pages/resourse/list/index.vue
  5. 6
      src/pages/workbench/list/index.vue
  6. 2
      src/setting.js

@ -29,12 +29,14 @@
</template>
<script>
import { mapState } from 'vuex'
import Setting from '@/setting'
export default {
props: ['path'],
data () {
return {
active: '',
menus: [
defaultMenus: [
{
index: '/assessment/list',
title: '考核管理'
@ -76,8 +78,14 @@ export default {
title: '备课管理'
},
],
menus: [],
};
},
computed: {
...mapState('auth', [
'btns'
])
},
watch: {
path: {
handler (val) {
@ -87,9 +95,21 @@ export default {
}
},
mounted () {
Setting.dynamicRoute && this.initTabs()
},
methods: {
initTabs () {
const { btns } = this
const tabs = this.defaultMenus
btns.includes('/assessment/list') && this.menus.push(tabs[0])
btns.includes('/achievement/list') && this.menus.push(tabs[1])
btns.includes('/evaluation/list') && this.menus.push(tabs[2])
btns.includes('/course/list') && this.menus.push(tabs[3])
btns.includes('/review') && this.menus.push(tabs[4])
btns.includes('/information/list') && this.menus.push(tabs[5])
btns.includes('/project/list') && this.menus.push(tabs[6])
btns.includes('/resourse/list') && this.menus.push(tabs[7])
},
handleSelect (index) {
},

@ -10,7 +10,7 @@
<div class="left">
<div class="flex-between">
<h6 class="title">课程目录</h6>
<el-button type="primary" size="mini" @click="addChapter" v-auth="'/curriculum:内容设置:添加章节'">新增章节</el-button>
<el-button type="primary" size="mini" @click="addChapter">新增章节</el-button>
</div>
<ul class="chapters">
<draggable v-model="chapters" :disabled="false" :group="{
@ -31,10 +31,10 @@
<el-input style="width: 300px" placeholder="请输入资源名称" prefix-icon="el-icon-search" v-model="keyword"
clearable></el-input>
<div>
<el-button class="action-btn" @click="showSource" v-auth="'/curriculum:内容设置:修改章节名称'">添加系统资源</el-button>
<el-button class="action-btn" @click="addSection" v-auth="'/curriculum:内容设置:添加小节'">本地上传</el-button>
<el-button class="action-btn" @click="move" v-auth="'/curriculum:内容设置:删除章节'">批量移动</el-button>
<el-button class="action-btn" v-auth="'/curriculum:内容设置:删除章节'" @click="batchDelSection">批量移除</el-button>
<el-button class="action-btn" @click="showSource">添加系统资源</el-button>
<el-button class="action-btn" @click="addSection">本地上传</el-button>
<el-button class="action-btn" @click="move">批量移动</el-button>
<el-button class="action-btn" @click="batchDelSection">批量移除</el-button>
</div>
</div>
@ -61,13 +61,11 @@
<span class="name">{{ section.name }}</span>
</div>
<div class="section-actions">
<el-button type="text" :disabled="section.isDownload === 0" @click="download(section)"
v-auth="'/curriculum:内容设置:下载'">下载</el-button>
<el-button type="text" @click="preview(section)" v-auth="'/curriculum:内容设置:查看'">预览</el-button>
<el-button type="text" @click="editSectionName(section)"
v-auth="'/curriculum:内容设置:修改小节名称'">修改资源名称</el-button>
<el-button type="text" @click="switchFile(section)" v-auth="'/curriculum:内容设置:更换文件'">更换</el-button>
<el-button type="text" @click="delSection(section)" v-auth="'/curriculum:内容设置:删除小节'">移除</el-button>
<el-button type="text" :disabled="section.isDownload === 0" @click="download(section)">下载</el-button>
<el-button type="text" @click="preview(section)">预览</el-button>
<el-button type="text" @click="editSectionName(section)">修改资源名称</el-button>
<el-button type="text" @click="switchFile(section)">更换</el-button>
<el-button type="text" @click="delSection(section)">移除</el-button>
</div>
</li>
</template>

@ -59,8 +59,8 @@
<span>课程列表</span>
</div>
<div>
<el-button type="primary" round @click="addcourse" v-auth>新建课程</el-button>
<el-button type="primary" round @click="delAllSelection" v-auth>批量删除</el-button>
<el-button type="primary" round @click="addcourse">新建课程</el-button>
<el-button type="primary" round @click="delAllSelection">批量删除</el-button>
</div>
</div>
<el-table v-loading="loading" :data="courseData" class="table" ref="table" header-align="center"
@ -84,17 +84,17 @@
<el-table-column label="上架/下架" width="90" align="center">
<template slot-scope="scope">
<el-switch v-model="scope.row.isShelves" :active-value="1" :inactive-value="0"
@change="changeSwitch($event, scope.row)" v-auth="'/curriculum:上下架'">
@change="changeSwitch($event, scope.row)">
</el-switch>
</template>
</el-table-column>
<el-table-column label="操作" width="240" align="center">
<template slot-scope="scope">
<el-button type="text" @click="preview(scope.row)">预览课程</el-button>
<el-button type="text" @click="edit(scope.row)" v-auth>编辑</el-button>
<el-button type="text" @click="config(scope.row)" v-auth>内容设置</el-button>
<el-button type="text" @click="edit(scope.row)">编辑</el-button>
<el-button type="text" @click="config(scope.row)">内容设置</el-button>
<el-button type="text" @click="copy(scope.row)">复制</el-button>
<el-button type="text" @click="handleDelete(scope.row)" v-auth>删除</el-button>
<el-button type="text" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>

@ -86,9 +86,9 @@
<el-table-column label="操作" align="center" width="180">
<template slot-scope="scope">
<template v-if="scope.row.isDownload || active">
<el-button type="text" @click="edit(scope.row)">编辑</el-button>
<el-button type="text" @click="download(scope.row)">下载</el-button>
</template>
<el-button type="text" @click="edit(scope.row)">编辑</el-button>
<el-button type="text" @click="download(scope.row)">下载</el-button>
</template>
<el-button type="text" @click="preview(scope.row)">预览</el-button>
<el-button v-if="scope.row.isDownload || active" type="text" @click="del(scope.row)">删除</el-button>
</template>
@ -150,6 +150,7 @@
</template>
<script>
import { mapState } from 'vuex'
import { Loading } from 'element-ui'
import Setting from '@/setting'
import Util from '@/libs/util'
@ -161,7 +162,7 @@ export default {
data () {
return {
active: +this.$route.query.type || 0,
tabs: [
defaultTabs: [
{
id: 0,
name: '教学课程'
@ -175,6 +176,7 @@ export default {
name: '文件素材'
},
],
tabs: [],
timer: null,
types: SourceConst.types,
courses: [],
@ -241,6 +243,11 @@ export default {
uploadVisible: false,
};
},
computed: {
...mapState('auth', [
'btns'
])
},
watch: {
"form.month": function (val) {
if (val) {
@ -268,11 +275,26 @@ export default {
}
},
mounted () {
Setting.dynamicRoute && this.initTabs()
this.insertScript()
this.getData()
this.getCourse()
},
methods: {
initTabs () {
const { btns } = this
const tab1 = btns.includes('/resourse/list:教学课程')
const tab2 = btns.includes('/resourse/list:精品课程')
const tab3 = btns.includes('/resourse/list:文件素材')
const tabs = this.defaultTabs
tab1 && this.tabs.push(tabs[0])
tab2 && this.tabs.push(tabs[1])
tab3 && this.tabs.push(tabs[2])
const type = +this.$route.query.type
this.active = this.tabs.find(e => e.id === type) ? type : this.tabs[0].id
},
async getData () {
this.loading = true
try {

@ -31,7 +31,7 @@
<img src="@/assets/img/workbench/7.png" alt="">
<p class="name">项目管理</p>
</div>
<div class="app" @click="to('/resourse')">
<div class="app" v-auth="'/resourse/list'" @click="to('/resourse')">
<img src="@/assets/img/workbench/8.png" alt="">
<p class="name">资源库</p>
</div>
@ -45,11 +45,11 @@
<img src="@/assets/img/workbench/9.png" alt="">
<p class="name">理论考试系统</p>
</div> -->
<div class="app" @click="to('/lesson')">
<div class="app" v-auth="'/lesson/list'" @click="to('/lesson')">
<img src="@/assets/img/workbench/10.png" alt="">
<p class="name">备课管理</p>
</div>
<div class="app" @click="to('/match')">
<div class="app" v-auth="'/match/list'" @click="to('/match')">
<img src="@/assets/img/workbench/11.png" alt="">
<p class="name">赛事管理专业版</p>
</div>

@ -97,7 +97,7 @@ const Setting = {
// 相同路由,不同参数间进行切换,是否强力更新
sameRouteForceUpdate: false,
// 是否使用动态路由(即角色权限,开启了的话就会取后端返回的权限树来显示头部导肮和页面按钮)
dynamicRoute: false,
dynamicRoute: true,
// 文件上传
upload: {
apiURL: uploadURL,

Loading…
Cancel
Save