|
|
|
@ -2,90 +2,162 @@ |
|
|
|
|
<!-- 平台自建 --> |
|
|
|
|
<div style="padding-top: 24px"> |
|
|
|
|
<div class="tool"> |
|
|
|
|
<ul class="filter" style="align-items: flex-start"> |
|
|
|
|
<ul class="filter" |
|
|
|
|
style="align-items: flex-start"> |
|
|
|
|
<li> |
|
|
|
|
<label>可见范围</label> |
|
|
|
|
<el-select v-model="form.visibleRange" clearable placeholder="请选择可见范围" @change="getData"> |
|
|
|
|
<el-option v-for="(item,index) in regions" :key="index" :label="item.name" :value="item.id"></el-option> |
|
|
|
|
<el-select v-model="form.visibleRange" |
|
|
|
|
clearable |
|
|
|
|
placeholder="请选择可见范围" |
|
|
|
|
@change="getData"> |
|
|
|
|
<el-option v-for="(item,index) in regions" |
|
|
|
|
:key="index" |
|
|
|
|
:label="item.name" |
|
|
|
|
:value="item.id"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</li> |
|
|
|
|
<li> |
|
|
|
|
<label>课程分类:</label> |
|
|
|
|
<el-select v-model="form.categoryId" clearable placeholder="请选择课程分类" @change="getData"> |
|
|
|
|
<el-option label="不限" value=""></el-option> |
|
|
|
|
<el-option label="暂无分类" value="0"></el-option> |
|
|
|
|
<el-option v-for="(item,index) in classificationList" :key="index" :label="item.classificationName" :value="item.id"></el-option> |
|
|
|
|
<el-select v-model="form.categoryId" |
|
|
|
|
clearable |
|
|
|
|
placeholder="请选择课程分类" |
|
|
|
|
@change="getData"> |
|
|
|
|
<el-option label="不限" |
|
|
|
|
value=""></el-option> |
|
|
|
|
<el-option label="暂无分类" |
|
|
|
|
value="0"></el-option> |
|
|
|
|
<el-option v-for="(item,index) in classificationList" |
|
|
|
|
:key="index" |
|
|
|
|
:label="item.classificationName" |
|
|
|
|
:value="item.id"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</li> |
|
|
|
|
<li> |
|
|
|
|
<label>课程类型:</label> |
|
|
|
|
<el-select v-model="form.courseType" clearable placeholder="请选择课程类型" @change="getData"> |
|
|
|
|
<el-option v-for="(item,index) in types" :key="index" :label="item.name" :value="item.id"></el-option> |
|
|
|
|
<el-select v-model="form.courseType" |
|
|
|
|
clearable |
|
|
|
|
placeholder="请选择课程类型" |
|
|
|
|
@change="getData"> |
|
|
|
|
<el-option v-for="(item,index) in types" |
|
|
|
|
:key="index" |
|
|
|
|
:label="item.name" |
|
|
|
|
:value="item.id"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</li> |
|
|
|
|
<li> |
|
|
|
|
<label>搜索:</label> |
|
|
|
|
<el-input placeholder="请输入理论课程名称/创建人" suffix-icon="el-icon-search" v-model="keyword" clearable size="small"></el-input> |
|
|
|
|
<el-input placeholder="请输入理论课程名称/创建人" |
|
|
|
|
suffix-icon="el-icon-search" |
|
|
|
|
v-model="keyword" |
|
|
|
|
clearable |
|
|
|
|
size="small"></el-input> |
|
|
|
|
</li> |
|
|
|
|
</ul> |
|
|
|
|
<div> |
|
|
|
|
<el-button v-auth="'平台自建:新增'" type="primary" round @click="addCourse">新增</el-button> |
|
|
|
|
<el-button v-auth="'平台自建:批量删除'" type="primary" round @click="delAllData">批量删除</el-button> |
|
|
|
|
<el-button v-auth="'平台自建:新增'" |
|
|
|
|
type="primary" |
|
|
|
|
round |
|
|
|
|
@click="addCourse">新增</el-button> |
|
|
|
|
<el-button v-auth="'平台自建:批量删除'" |
|
|
|
|
type="primary" |
|
|
|
|
round |
|
|
|
|
@click="delAllData">批量删除</el-button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<el-table :data="list" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id"> |
|
|
|
|
<el-table-column type="selection" width="80" align="center" :reserve-selection="true"></el-table-column> |
|
|
|
|
<el-table-column type="index" width="100" label="序号" align="center"> |
|
|
|
|
<el-table :data="list" |
|
|
|
|
class="table" |
|
|
|
|
ref="table" |
|
|
|
|
stripe |
|
|
|
|
header-align="center" |
|
|
|
|
@selection-change="handleSelectionChange" |
|
|
|
|
row-key="id"> |
|
|
|
|
<el-table-column type="selection" |
|
|
|
|
width="80" |
|
|
|
|
align="center" |
|
|
|
|
:reserve-selection="true"></el-table-column> |
|
|
|
|
<el-table-column type="index" |
|
|
|
|
width="100" |
|
|
|
|
label="序号" |
|
|
|
|
align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{ scope.$index + (page - 1) * pageSize + 1 }} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="courseName" label="课程名称" align="center"> |
|
|
|
|
<el-table-column prop="courseName" |
|
|
|
|
label="课程名称" |
|
|
|
|
align="center"> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="可见范围" align="center"> |
|
|
|
|
<el-table-column label="可见范围" |
|
|
|
|
align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{ regionName[scope.row.visibleRange] }} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="createTime" label="创建时间" align="center"> |
|
|
|
|
<el-table-column prop="createTime" |
|
|
|
|
label="创建时间" |
|
|
|
|
align="center"> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="courseClassification" label="课程类型" align="center"> |
|
|
|
|
<el-table-column prop="courseClassification" |
|
|
|
|
label="课程类型" |
|
|
|
|
align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{ scope.row.courseType == 1 ? '付费' : '免费' }} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="founder" label="创建人" align="center"> |
|
|
|
|
<el-table-column prop="founder" |
|
|
|
|
label="创建人" |
|
|
|
|
align="center"> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="courseClassification" label="课程分类" align="center" show-overflow-tooltip> |
|
|
|
|
<el-table-column prop="courseClassification" |
|
|
|
|
label="课程分类" |
|
|
|
|
align="center" |
|
|
|
|
show-overflow-tooltip> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="操作" align="center" width="250"> |
|
|
|
|
<el-table-column label="操作" |
|
|
|
|
align="center" |
|
|
|
|
width="250"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-button v-auth="'平台自建:编辑信息'" type="text" @click="editCourse(scope.row)">编辑信息</el-button> |
|
|
|
|
<el-divider v-auth="'平台自建:编辑信息'" direction="vertical"></el-divider> |
|
|
|
|
<el-button v-auth="'平台自建:内容设置'" type="text" @click="config(scope.row)">内容设置</el-button> |
|
|
|
|
<el-divider v-auth="'平台自建:内容设置'" direction="vertical"></el-divider> |
|
|
|
|
<el-button v-auth="'平台自建:预览'" type="text" @click="preview(scope.row)">预览</el-button> |
|
|
|
|
<el-divider v-auth="'平台自建:预览'" direction="vertical"></el-divider> |
|
|
|
|
<el-button v-auth="'平台自建:删除'" type="text" @click="handleDelete(scope.row)">删除</el-button> |
|
|
|
|
<el-button v-auth="'平台自建:编辑信息'" |
|
|
|
|
type="text" |
|
|
|
|
@click="editCourse(scope.row)">编辑信息</el-button> |
|
|
|
|
<el-divider v-auth="'平台自建:编辑信息'" |
|
|
|
|
direction="vertical"></el-divider> |
|
|
|
|
<el-button v-auth="'平台自建:内容设置'" |
|
|
|
|
type="text" |
|
|
|
|
@click="config(scope.row)">内容设置</el-button> |
|
|
|
|
<el-divider v-auth="'平台自建:内容设置'" |
|
|
|
|
direction="vertical"></el-divider> |
|
|
|
|
<el-button v-auth="'平台自建:预览'" |
|
|
|
|
type="text" |
|
|
|
|
@click="preview(scope.row)">预览</el-button> |
|
|
|
|
<el-divider v-auth="'平台自建:预览'" |
|
|
|
|
direction="vertical"></el-divider> |
|
|
|
|
<el-button v-auth="'平台自建:删除'" |
|
|
|
|
type="text" |
|
|
|
|
@click="handleDelete(scope.row)">删除</el-button> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="可授权状态" align="center" width="120"> |
|
|
|
|
<el-table-column label="可授权状态" |
|
|
|
|
align="center" |
|
|
|
|
width="120"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-switch |
|
|
|
|
v-auth="'平台自建:禁用'" |
|
|
|
|
<el-switch v-auth="'平台自建:禁用'" |
|
|
|
|
v-model="scope.row.ztOpen" |
|
|
|
|
:active-value="0" |
|
|
|
|
:inactive-value="1" |
|
|
|
|
style="margin: 0 10px 0 5px" |
|
|
|
|
:active-text="scope.row.ztOpen ? '关' : '开'" |
|
|
|
|
@change="switchOff($event,scope.row,scope.$index)" |
|
|
|
|
></el-switch> |
|
|
|
|
@change="switchOff($event,scope.row,scope.$index)"></el-switch> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
|
<div class="pagination"> |
|
|
|
|
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="page"> |
|
|
|
|
<el-pagination background |
|
|
|
|
layout="total, prev, pager, next" |
|
|
|
|
:total="total" |
|
|
|
|
@current-change="handleCurrentChange" |
|
|
|
|
:current-page="page"> |
|
|
|
|
</el-pagination> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
@ -95,7 +167,7 @@ |
|
|
|
|
import util from "@/libs/util"; |
|
|
|
|
import Setting from '@/setting' |
|
|
|
|
export default { |
|
|
|
|
data() { |
|
|
|
|
data () { |
|
|
|
|
return { |
|
|
|
|
timer: null, |
|
|
|
|
regionName: ['本校内', '全平台可见', '指定院校区域'], |
|
|
|
@ -143,17 +215,17 @@ export default { |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
watch: { |
|
|
|
|
keyword: function(val) { |
|
|
|
|
keyword: function (val) { |
|
|
|
|
clearTimeout(this.searchTimer); |
|
|
|
|
this.searchTimer = setTimeout(() => { |
|
|
|
|
this.initData(); |
|
|
|
|
}, 500); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
mounted () { |
|
|
|
|
this.getClassification(); |
|
|
|
|
this.getData(); |
|
|
|
|
this.$once('hook:beforeDestroy', function() { |
|
|
|
|
this.$once('hook:beforeDestroy', function () { |
|
|
|
|
clearInterval(this.timer) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
@ -162,7 +234,7 @@ export default { |
|
|
|
|
// 用户创建的理论课程,禁用时职站首页以及学生登录后的理论课程模块看不到对应的课程,创建的老师在理论课程管理还是可以看到该理论课程,可以编辑,但是无法启用。 |
|
|
|
|
// 即中台禁用的理论课程,即使是该院校老师创建的,老师端也不能自己启用,需要中台启用。 |
|
|
|
|
//1.判断当前院校禁启用状态为要启用时候再判断当前课程中台禁启用的状态 |
|
|
|
|
getList() { |
|
|
|
|
getList () { |
|
|
|
|
this.$post(this.api.listTheoreticalCourse, { |
|
|
|
|
pageNum: this.page, |
|
|
|
|
pageSize: this.pageSize, |
|
|
|
@ -181,48 +253,48 @@ export default { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 获取redis缓存 |
|
|
|
|
getRedis() { |
|
|
|
|
getRedis () { |
|
|
|
|
this.$post(this.api.getRedisCache).then(({ data }) => { |
|
|
|
|
data && this.getList() |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
}, |
|
|
|
|
getData() { |
|
|
|
|
getData () { |
|
|
|
|
this.getList() |
|
|
|
|
if (!Setting.isDev) { |
|
|
|
|
clearInterval(this.timer) |
|
|
|
|
this.timer = setInterval(this.getRedis, 1000) |
|
|
|
|
} |
|
|
|
|
// if (!Setting.isDev) { |
|
|
|
|
// clearInterval(this.timer) |
|
|
|
|
// this.timer = setInterval(this.getRedis, 1000) |
|
|
|
|
// } |
|
|
|
|
}, |
|
|
|
|
initData() { |
|
|
|
|
initData () { |
|
|
|
|
this.page = 1; |
|
|
|
|
this.getData(); |
|
|
|
|
}, |
|
|
|
|
getClassification() { |
|
|
|
|
getClassification () { |
|
|
|
|
this.$post(this.api.listClassification, { |
|
|
|
|
pageNum: 1, |
|
|
|
|
pageSize: 1000, |
|
|
|
|
platformSource: Setting.platformSource |
|
|
|
|
}).then(({ page }) => { |
|
|
|
|
this.classificationList = page.records |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
}, |
|
|
|
|
changeType(type) { |
|
|
|
|
changeType (type) { |
|
|
|
|
this.classificationId = type; |
|
|
|
|
this.initData(); |
|
|
|
|
}, |
|
|
|
|
preview(row) { |
|
|
|
|
preview (row) { |
|
|
|
|
this.$router.push(`/previewTheoreticalCourse?id=${row.id}`); |
|
|
|
|
}, |
|
|
|
|
config(row) { |
|
|
|
|
config (row) { |
|
|
|
|
this.$router.push(`/setTheoreticalCourse?id=${row.id}`); |
|
|
|
|
}, |
|
|
|
|
addCourse() { |
|
|
|
|
addCourse () { |
|
|
|
|
this.$router.push("/addTheoreticalCourse"); |
|
|
|
|
}, |
|
|
|
|
editCourse(row) { |
|
|
|
|
editCourse (row) { |
|
|
|
|
this.$router.push(`/addTheoreticalCourse?id=${row.id}`); |
|
|
|
|
}, |
|
|
|
|
handleDelete(row) { |
|
|
|
|
handleDelete (row) { |
|
|
|
|
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", { |
|
|
|
|
type: "warning" |
|
|
|
|
}) |
|
|
|
@ -236,10 +308,10 @@ export default { |
|
|
|
|
.catch(() => { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
handleSelectionChange(val) { |
|
|
|
|
handleSelectionChange (val) { |
|
|
|
|
this.multipleSelection = val; |
|
|
|
|
}, |
|
|
|
|
delAllData() { |
|
|
|
|
delAllData () { |
|
|
|
|
const list = this.multipleSelection |
|
|
|
|
if (list.length != "") { |
|
|
|
|
this.$confirm(`确定要删除吗?`, "提示", { |
|
|
|
@ -262,18 +334,18 @@ export default { |
|
|
|
|
util.errorMsg("请先选择数据 !"); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
handleCurrentChange(val) { |
|
|
|
|
handleCurrentChange (val) { |
|
|
|
|
this.page = val; |
|
|
|
|
this.getData(); |
|
|
|
|
}, |
|
|
|
|
switchOff(val, row) { |
|
|
|
|
switchOff (val, row) { |
|
|
|
|
this.$post(this.api.disabledTheoreticalCourse, { |
|
|
|
|
courseId: row.id, |
|
|
|
|
isOpen: val, |
|
|
|
|
type: 0 // 禁用平台来源(0中台,1职站) |
|
|
|
|
}).then(res => { |
|
|
|
|
val == 1 ? util.warningMsg('禁用成功') : util.successMsg('启用成功') |
|
|
|
|
}).catch(err => {}) |
|
|
|
|
}).catch(err => { }) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|