课程等修复

fixAuth
yujialong 2 years ago
parent 28e4da3e49
commit d366b227d2
  1. 15
      src/assets/css/main.css
  2. 6
      src/components/menuTree/index.vue
  3. 4
      src/setting.js
  4. 42
      src/utils/api.js
  5. 24
      src/views/course/AddCurriculum.vue
  6. 1
      src/views/course/contentSettings.vue
  7. 110
      src/views/information/addArticle/index.vue
  8. 65
      src/views/information/columnManage/index.vue
  9. 2
      src/views/information/contentManage/contentList.vue
  10. 53
      src/views/information/contentManage/index.vue
  11. 5
      src/views/order/AddOrder.vue
  12. 29
      src/views/theoreticalCourse/add/index.vue
  13. 84
      src/views/theoreticalCourse/contentSettings/index.vue
  14. 37
      src/views/theoreticalCourse/list/buildPlatform/index.vue
  15. 79
      src/views/theoreticalCourse/list/courseManagement/index.vue
  16. 2
      src/views/theoreticalCourse/list/sortManagement/index.vue
  17. 13
      src/views/theoreticalCourse/preview/index.vue

@ -39,6 +39,21 @@ li {
border-radius: 6px; border-radius: 6px;
background: #d7d7d7; background: #d7d7d7;
} }
.flex {
display: flex;
}
.j-between {
justify-content: space-between;
}
.a-center {
align-items: center;
}
.m-b-10 {
margin-bottom: 10px;
}
.el-table th>.cell {
font-size: 14px;
}
.content-box { .content-box {
-webkit-transition: left .3s ease-in-out; -webkit-transition: left .3s ease-in-out;
transition: left .3s ease-in-out; transition: left .3s ease-in-out;

@ -1,9 +1,10 @@
<template> <template>
<div> <div>
<template v-for="item in this.menuList"> <template v-for="item in this.menuList">
<el-submenu :key="item.id" :index="item.id" v-if="item.children && item.children.length"> <el-submenu :key="item.id" :index="item.id" v-if="item.children && item.children.length">
<template slot="title"> <template slot="title">
<span slot="title">{{item.name}}</span> <span :class="{active: curId == item.id}">{{item.name}}</span>
</template> </template>
<menuTree :menuList="item.children"></menuTree> <menuTree :menuList="item.children"></menuTree>
</el-submenu> </el-submenu>
@ -21,6 +22,9 @@
menuList: { menuList: {
type: Array, type: Array,
default: [] default: []
},
curId: {
default: ''
} }
}, },
data () { data () {

@ -11,8 +11,8 @@ if (isDev) {
jumpPath = 'http://192.168.31.125:8087/' // 本地调试-需要启动本地判分点系统 jumpPath = 'http://192.168.31.125:8087/' // 本地调试-需要启动本地判分点系统
host = 'http://121.37.12.51/' host = 'http://121.37.12.51/'
// host = 'https://huorantech.cn/' // host = 'https://huorantech.cn/'
host = 'http://192.168.31.151:9000/'// 榕 // host = 'http://192.168.31.151:9000/'// 榕
host = 'http://192.168.31.137:9000/'// 赓 // host = 'http://192.168.31.137:9000/'// 赓
} else if (isPro) { } else if (isPro) {
jumpPath = 'https://www.huorantech.cn/judgmentPoint/' jumpPath = 'https://www.huorantech.cn/judgmentPoint/'
} }

@ -155,29 +155,43 @@ export default {
updateTheoreticalCourse: `occupationlab/occupationlab/theoreticalCourse/update`, updateTheoreticalCourse: `occupationlab/occupationlab/theoreticalCourse/update`,
disabledTheoreticalCourse: `occupationlab/occupationlab/theoreticalCourse/disabledEvents`, disabledTheoreticalCourse: `occupationlab/occupationlab/theoreticalCourse/disabledEvents`,
checkRepeatTheoreticalCourse: `occupationlab/occupationlab/theoreticalCourse/checkRepeat`, checkRepeatTheoreticalCourse: `occupationlab/occupationlab/theoreticalCourse/checkRepeat`,
getRedisCache: `occupationlab/occupationlab/theoreticalCourse/getRedisCache`,
// 理论课程分类管理 // 理论课程分类管理
checkRepeatClassification: `occupationlab/occupationlab/theoreticalCourseClassification/checkRepeat`, checkRepeatClassification: `occupationlab/occupationlab/theoreticalCourseClassification/checkRepeat`,
delClassification: `occupationlab/occupationlab/theoreticalCourseClassification/delete`, delClassification: `occupationlab/occupationlab/theoreticalCourseClassification/batchDeletion`,
findClassification: `occupationlab/occupationlab/theoreticalCourseClassification/findById`, findClassification: `occupationlab/occupationlab/theoreticalCourseClassification/findById`,
listClassification: `occupationlab/occupationlab/theoreticalCourseClassification/pagingQuery`, listClassification: `occupationlab/occupationlab/theoreticalCourseClassification/pagingQuery`,
saveClassification: `occupationlab/occupationlab/theoreticalCourseClassification/save`, saveClassification: `occupationlab/occupationlab/theoreticalCourseClassification/save`,
updateClassification: `occupationlab/occupationlab/theoreticalCourseClassification/update`, updateClassification: `occupationlab/occupationlab/theoreticalCourseClassification/update`,
queryAllCategoriesOfSchools: `occupationlab/occupationlab/theoreticalCourseClassification/queryAllCategoriesOfSchools`,
// 课程章节管理
addChapterTheoretical: `occupationlab/occupationlab/theoreticalCourseChapter/addChapter`,
chapterReorderTheoretical: `occupationlab/occupationlab/theoreticalCourseChapter/chapterReorder`,
deleteChapterTheoretical: `occupationlab/occupationlab/theoreticalCourseChapter/deleteChapter`,
editChapterTheoretical: `occupationlab/occupationlab/theoreticalCourseChapter/editChapter`,
queryChaptersTheoretical: `occupationlab/occupationlab/theoreticalCourseChapter/queryChaptersAndSubsections`,
reorderTheoretical: `occupationlab/occupationlab/theoreticalCourseChapter/reorder`,
// 课程小节管理
addSubsectionTheoretical: `occupationlab/occupationlab/theoreticalCourseSubsection/addSubsection`, // 添加小节
deleteSubsectionTheoretical: `occupationlab/occupationlab/theoreticalCourseSubsection/deleteSubsection`, // 根据id删除小节
editSubsectionTheoretical: `occupationlab/occupationlab/theoreticalCourseSubsection/editSubsection`, // 修改小节
getSubsectionTheoretical: `occupationlab/occupationlab/theoreticalCourseSubsection/getSubsection`, // 根据小节id获取预览文件地址
// 栏目管理 // 栏目管理
addColumn: `${host1}occupationlab/occupationlab/information/column/addColumn`, addColumn: `occupationlab/occupationlab/information/column/addColumn`,
deleteColumn: `${host1}occupationlab/occupationlab/information/column/deleteColumn`, deleteColumn: `occupationlab/occupationlab/information/column/deleteColumn`,
editColumn: `${host1}occupationlab/occupationlab/information/column/editColumn`, editColumn: `occupationlab/occupationlab/information/column/editColumn`,
queryAllColumns: `${host1}occupationlab/occupationlab/information/column/queryAllColumns`, queryAllColumns: `occupationlab/occupationlab/information/column/queryAllColumns`,
columnReorder: `${host1}occupationlab/occupationlab/information/column/reorder`, columnReorder: `occupationlab/occupationlab/information/column/reorder`,
// 内容管理 // 内容管理
addArticle: `${host1}occupationlab/occupationlab/information/article/addArticle`, addArticle: `occupationlab/occupationlab/information/article/addArticle`,
deleteArticles: `${host1}occupationlab/occupationlab/information/article/deleteArticles`, deleteArticles: `occupationlab/occupationlab/information/article/deleteArticles`,
editArticle: `${host1}occupationlab/occupationlab/information/article/editArticle`, editArticle: `occupationlab/occupationlab/information/article/editArticle`,
enableArticle: `${host1}occupationlab/occupationlab/information/article/enableArticle`, enableArticle: `occupationlab/occupationlab/information/article/enableArticle`,
getArticle: `${host1}occupationlab/occupationlab/information/article/getArticle`, getArticle: `occupationlab/occupationlab/information/article/getArticle`,
getArticles: `${host1}occupationlab/occupationlab/information/article/getArticles`, getArticles: `occupationlab/occupationlab/information/article/getArticles`,
queryArticleByCondition: `${host1}occupationlab/occupationlab/information/article/queryArticleByCondition`, queryArticleByCondition: `occupationlab/occupationlab/information/article/queryArticleByCondition`,
articleSort: `${host1}occupationlab/occupationlab/information/article/articleSort`, articleSort: `occupationlab/occupationlab/information/article/articleSort`,
// 阿里云文件/视频管理 // 阿里云文件/视频管理
fileDeletion: `${uploadURL}oss/manage/fileDeletion`, // 删除OSS文件 fileDeletion: `${uploadURL}oss/manage/fileDeletion`, // 删除OSS文件

@ -296,7 +296,7 @@
<el-input placeholder="请输入项目名称" prefix-icon="el-icon-search" v-model.trim="projectKeyword" clearable></el-input> <el-input placeholder="请输入项目名称" prefix-icon="el-icon-search" v-model.trim="projectKeyword" clearable></el-input>
<ul class="systems"> <ul class="systems">
<el-checkbox v-if="projects.length" v-model="checkAll" label="全选" @change="val => systemChange(val, { systemId: projects[0].systemId })"></el-checkbox> <el-checkbox v-if="projects.length" v-model="checkAll" label="全选" @change="val => checkAllChange(val, projects[0].systemId)"></el-checkbox>
<li v-for="(item, i) in projects" :key="i" :title="item.projectName"> <li v-for="(item, i) in projects" :key="i" :title="item.projectName">
<el-checkbox v-model="item.check" :label="item.projectName" @change="val => projectChange(val, item)"></el-checkbox> <el-checkbox v-model="item.check" :label="item.projectName" @change="val => projectChange(val, item)"></el-checkbox>
</li> </li>
@ -619,6 +619,7 @@ export default {
list.map(e => { list.map(e => {
// //
// if (!checked.find(n => n.systemId == e.systemId)) { // if (!checked.find(n => n.systemId == e.systemId)) {
// e.check = !!checked.find(n => n.systemId == e.systemId)
e.check = false e.check = false
result.push(e) result.push(e)
// } // }
@ -641,6 +642,7 @@ export default {
e.check = include e.check = include
result.push(e) result.push(e)
}) })
this.checkAll = !result.filter(e => !e.check).length
this.projects = result this.projects = result
}).catch(err => {}) }).catch(err => {})
}, },
@ -677,6 +679,13 @@ export default {
this.checkedAll = JSON.parse(JSON.stringify(checkeds)) // this.checkedAll = JSON.parse(JSON.stringify(checkeds)) //
}).catch(err => {}) }).catch(err => {})
}, },
//
checkAllChange(val, systemId) {
this.systemChange(val, { systemId })
this.systems.map(e => {
if (e.systemId == systemId) e.check = val
})
},
// //
projectChange(val, item) { projectChange(val, item) {
const { systemId } = item const { systemId } = item
@ -685,12 +694,13 @@ export default {
if (val) { if (val) {
this.checkeds.push(item) this.checkeds.push(item)
} else if (i !== -1) { } else if (i !== -1) {
this.systems.map(e => {
if (e.systemId == systemId) e.check = false
})
this.checkeds.splice(i, 1) this.checkeds.splice(i, 1)
} }
this.checkAll = !this.projects.find(e => !e.check) //
this.systems.map(e => {
if (e.systemId == systemId) e.check = !this.projects.filter(n => !n.check).length
})
this.checkAll = !this.projects.find(e => !e.check) //
this.checkedAll = JSON.parse(JSON.stringify(this.checkeds)) // this.checkedAll = JSON.parse(JSON.stringify(this.checkeds)) //
}, },
// //
@ -712,7 +722,11 @@ export default {
n.check = false n.check = false
} }
}) })
this.checkAll = !this.projects.find(e => !e.check)
} }
this.systems.map(n => {
if (n.systemId == e.systemId) n.check = false
})
}).catch(() => {}) }).catch(() => {})
}, },
// //

@ -97,7 +97,6 @@
:action="this.api.fileupload" :action="this.api.fileupload"
:file-list="uploadList" :file-list="uploadList"
:headers="headers" :headers="headers"
:http-request="handleRequest"
name="file" name="file"
> >
<el-button size="small"><img src="@/assets/img/upload.png" alt=""> 上传资源</el-button> <el-button size="small"><img src="@/assets/img/upload.png" alt=""> 上传资源</el-button>

@ -6,8 +6,8 @@
</div> </div>
</el-card> </el-card>
<el-card shadow="hover" class="m-b-20"> <el-card shadow="hover" class="m-b-20">
<el-form label-width="90px" label-suffix=":" size="small"> <el-form :model="form" :rules="rules" ref="form" label-width="90px" label-suffix=":" size="small">
<el-form-item label="封面图"> <el-form-item prop="coverUrl" label="封面图">
<el-upload <el-upload
class="avatar-uploader" class="avatar-uploader"
accept=".jpg,.png,.jpeg" accept=".jpg,.png,.jpeg"
@ -21,28 +21,28 @@
:headers="headers" :headers="headers"
name="file" name="file"
> >
<img v-if="coverUrl" :src="coverUrl" class="avatar"> <img v-if="form.coverUrl" :src="form.coverUrl" class="avatar">
<div class="uploader-default" v-else> <div class="uploader-default" v-else>
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
<p>上传封面</p> <p>上传封面</p>
</div> </div>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item label="作者"> <el-form-item prop="author" label="作者">
<div class="d-inline-block"> <div class="d-inline-block">
<el-input placeholder="请输入作者" v-model="author" clearable></el-input> <el-input placeholder="请输入作者" v-model="form.author" clearable></el-input>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="日期"> <el-form-item prop="date" label="日期">
<div class="d-inline-block"> <div class="d-inline-block">
<el-date-picker v-model="date" type="date" value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择日期"></el-date-picker> <el-date-picker v-model="form.date" type="date" value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择日期"></el-date-picker>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="文章标题"> <el-form-item prop="title" label="文章标题">
<el-input placeholder="请输入文章标题" v-model="title" clearable></el-input> <el-input placeholder="请输入文章标题" v-model="form.title" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item label="文章内容"> <el-form-item prop="content" label="文章内容">
<quill :border="true" v-model="content" :uploading.sync="uploading" :height="400" /> <quill :border="true" v-model="form.content" :uploading.sync="uploading" :height="400" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="saveData">确定</el-button> <el-button type="primary" @click="saveData">确定</el-button>
@ -62,16 +62,36 @@ export default {
headers: { headers: {
token: sessionStorage.getItem('token') token: sessionStorage.getItem('token')
}, },
form: {
columnId: +this.$route.query.columnId, columnId: +this.$route.query.columnId,
sort: +this.$route.query.sort, sort: +this.$route.query.sort,
id: "", id: '',
coverUrl: "", coverUrl: '',
author: '',
date: '',
title: '',
content: '',
createUser: this.$store.state.userName
},
rules: {
coverUrl: [
{ required: true, message: '请上传封面', trigger: 'change' }
],
author: [
{ required: true, message: '请输入作者', trigger: 'blur' }
],
date: [
{ required: true, message: '请选择日期', trigger: 'change' }
],
title: [
{ required: true, message: '请输入文章标题', trigger: 'blur' }
],
content: [
{ required: true, message: '请输入文章内容', trigger: 'blur' }
],
},
uploadList: [], uploadList: [],
uploadDataList: [], uploadDataList: [],
author: "",
date: "",
title: "",
content: "",
submiting: false, submiting: false,
uploading: false uploading: false
}; };
@ -89,42 +109,19 @@ export default {
this.$router.back(); this.$router.back();
}, },
getData() { getData() {
this.$get(`${this.api.getArticle}/${this.id}`) this.$get(`${this.api.getArticle}/${this.id}`).then(({ article }) => {
.then(res => { this.form = article
let data = res.article; }).catch(err => {})
this.coverUrl = data.coverUrl;
this.author = data.author;
this.date = data.date;
this.title = data.title;
this.content = data.content;
})
.catch(err => {
});
}, },
saveData() { saveData() {
if (this.submiting) return false; this.$refs.form.validate((valid) => {
if (!this.coverUrl) return util.warningMsg("请上传封面图"); if (valid) {
if (!this.author) return util.warningMsg("请填写作者"); if (this.submiting) return false
if (!this.date) return util.warningMsg("请选择日期"); const { form } = this
if (!this.title) return util.warningMsg("请填写文章标题");
if (!this.content) return util.warningMsg("请填写文章内容");
if (this.uploading) return util.warningMsg("图片正在上传中,请稍等"); if (this.uploading) return util.warningMsg("图片正在上传中,请稍等");
this.submiting = true; this.submiting = true
if (form.id) {
let data = { this.$put(this.api.editArticle, form).then(res => {
id: this.id,
columnId: this.columnId,
author: this.author,
coverUrl: this.coverUrl,
date: this.date,
title: this.title,
content: this.content,
sort: this.sort,
createUser: this.$store.state.userName
};
if (this.id) {
this.$put(this.api.editArticle, data).then(res => {
this.submiting = false; this.submiting = false;
util.successMsg("修改成功"); util.successMsg("修改成功");
this.back(); this.back();
@ -133,7 +130,7 @@ export default {
this.submiting = false; this.submiting = false;
}); });
} else { } else {
this.$post(this.api.addArticle, data).then(res => { this.$post(this.api.addArticle, form).then(res => {
this.submiting = false; this.submiting = false;
util.successMsg("创建成功"); util.successMsg("创建成功");
this.back(); this.back();
@ -142,6 +139,8 @@ export default {
this.submiting = false; this.submiting = false;
}); });
} }
}
})
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.currPage = val; this.currPage = val;
@ -150,13 +149,13 @@ export default {
util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`); util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`);
}, },
uploadSuccess(res, file, fileList) { uploadSuccess(res, file, fileList) {
if (this.coverUrl) { if (this.form.coverUrl) {
let fileName = this.coverUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", ""); let fileName = this.coverUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", "");
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => { this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
}).catch(res => { }).catch(res => {
}); });
} }
this.coverUrl = res.data.filesResult.fileUrl; this.form.coverUrl = res.data.filesResult.fileUrl;
}, },
uploadError(err, file, fileList) { uploadError(err, file, fileList) {
this.$message({ this.$message({
@ -169,9 +168,9 @@ export default {
return this.$confirm(`确定移除 ${file.name}`); return this.$confirm(`确定移除 ${file.name}`);
}, },
handleRemove(file, fileList) { handleRemove(file, fileList) {
let fileName = this.coverUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", ""); let fileName = this.form.coverUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", "");
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => { this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
this.coverUrl = ""; this.form.coverUrl = "";
}).catch(res => { }).catch(res => {
}); });
}, },
@ -182,7 +181,6 @@ export default {
this.getData(); this.getData();
}, },
back() { back() {
// this.$router.push(`/content?id=${this.columnId}`)
this.$router.back(); this.$router.back();
}, },
goback() { goback() {

@ -21,8 +21,7 @@
<span><em :class="{hide: sorting}" style="font-style: normal">操作</em></span> <span><em :class="{hide: sorting}" style="font-style: normal">操作</em></span>
</div> </div>
</div> </div>
<el-tree :data="listData" node-key="id" default-expand-all @node-drop="handleDrop" <el-tree :data="listData" node-key="id" default-expand-all :draggable="sorting" :allow-drop="allowDrop">
:draggable="sorting" :allow-drop="allowDrop" :allow-drag="allowDrag">
<span class="custom-tree-node" slot-scope="{ node, data }"> <span class="custom-tree-node" slot-scope="{ node, data }">
<span class="name">{{ data.name }}</span> <span class="name">{{ data.name }}</span>
<span class="action" v-show="!sorting"> <span class="action" v-show="!sorting">
@ -81,7 +80,8 @@ export default {
isAddType: false, isAddType: false,
defaultProps: { defaultProps: {
label: "name" label: "name"
} },
level: 0
}; };
}, },
mounted() { mounted() {
@ -104,9 +104,7 @@ export default {
methods: { methods: {
getData() { getData() {
this.$get(this.api.queryAllColumns, { this.$get(this.api.queryAllColumns, {
platformId: Setting.platformId, school: 0
page: this.pageNo,
size: this.pageSize
}).then(({ columnTree }) => { }).then(({ columnTree }) => {
this.listData = columnTree this.listData = columnTree
this.originalList = JSON.parse(JSON.stringify(this.listData)); this.originalList = JSON.parse(JSON.stringify(this.listData));
@ -142,27 +140,27 @@ export default {
} }
} }
}, },
// list
handleList(data, parent = {}) {
data.map((n, i) => {
n.parentId = parent.id || 0
n.level = this.level
n.sort = i
if (n.children.length) {
this.level++
this.handleList(n.children, n)
} else {
this.level = 0
}
})
},
sortSubmit() { sortSubmit() {
let list = JSON.parse(JSON.stringify(this.listData)); this.level = 0
list.forEach((n, k) => { let list = JSON.parse(JSON.stringify(this.listData))
n.name = n.label; this.handleList(list)
n.parentId = 1; this.$post(this.api.columnReorder, {
n.level = 1; columnTree: list
n.sort = k + 1; }).then(res => {
n.children && n.children.forEach((j, i) => {
j.name = j.label;
j.parentId = n.id;
j.level = 2;
j.sort = i + 1;
delete j.label;
j.secondColumn = [];
});
delete n.label;
n.secondColumn = n.children;
n.children = null;
});
let data = { columnTree: list };
this.$post(this.api.columnReorder, data).then(res => {
util.successMsg("保存成功"); util.successMsg("保存成功");
this.sorting = false; this.sorting = false;
this.getData(); this.getData();
@ -199,10 +197,6 @@ export default {
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val;
}, },
onSearch() {
this.pageNo = 1;
this.getData();
},
handleCurrentChange(val) { handleCurrentChange(val) {
this.pageNo = val; this.pageNo = val;
this.getData(); this.getData();
@ -210,20 +204,15 @@ export default {
closeColumn() { closeColumn() {
this.curRow = {} this.curRow = {}
}, },
handleDrop(draggingNode, dropNode, dropType, ev) {
// console.log('tree drop: ', dropNode, dropType);
},
allowDrop(draggingNode, dropNode, type) { allowDrop(draggingNode, dropNode, type) {
if (dropNode.level == 2 && draggingNode.childNodes.length == 0) { console.log("🚀 ~ file: index.vue ~ line 207 ~ allowDrop ~ draggingNode, dropNode, type", draggingNode, dropNode.level, type)
if (dropNode.level == 4 && draggingNode.childNodes.length == 0) {
return type !== "inner"; return type !== "inner";
} else if ((draggingNode.childNodes.length > 0 && dropNode.level == 2) || (draggingNode.childNodes.length > 0 && type == "inner")) { } else if ((draggingNode.childNodes.length > 0 && dropNode.level == 4) || (draggingNode.childNodes.length > 0 && type == "inner")) {
return false; return false;
} else { } else {
return true; return true;
} }
},
allowDrag(draggingNode) {
return draggingNode.data.label.indexOf("三级 3-2-2") === -1;
} }
} }
}; };

@ -16,7 +16,7 @@
{{ scope.$index + (pageNo - 1) * pageSize + 1 }} {{ scope.$index + (pageNo - 1) * pageSize + 1 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="title" label="标题" show-overflow-tooltip> <el-table-column prop="title" label="标题" show-overflow-tooltip align="center">
</el-table-column> </el-table-column>
<el-table-column prop="name" label="排序值" width="80" align="center"> <el-table-column prop="name" label="排序值" width="80" align="center">
<template slot-scope="scope"> <template slot-scope="scope">

@ -1,24 +1,22 @@
<template> <template>
<!-- 内容管理 --> <!-- 内容管理 -->
<div> <div class="flex">
<el-row :gutter="20">
<el-col :span="3">
<div class="menu-con"> <div class="menu-con">
<el-menu <el-menu
ref="columnMenu" ref="columnMenu"
unique-opened
text-color="#303133" text-color="#303133"
:default-openeds="ids"
:default-active="activeName" :default-active="activeName"
@open="menuClick"
@close="menuClick"
@select="handleSelect" @select="handleSelect"
> >
<menuTree :menuList="menuList"></menuTree> <menuTree :menuList="menuList" :curId.sync="curId"></menuTree>
</el-menu> </el-menu>
</div> </div>
</el-col> <div class="right">
<el-col :span="21">
<ContentList v-show="menuList.length" :columnId="columnId" /> <ContentList v-show="menuList.length" :columnId="columnId" />
</el-col> </div>
</el-row>
</div> </div>
</template> </template>
@ -36,7 +34,9 @@ export default {
return { return {
menuList: [], menuList: [],
activeName: this.$store.state.columnId, activeName: this.$store.state.columnId,
columnId: "" columnId: "",
ids: [],
curId: ''
}; };
}, },
mounted() { mounted() {
@ -45,27 +45,38 @@ export default {
methods: { methods: {
getMenuData() { getMenuData() {
this.$get(this.api.queryAllColumns, { this.$get(this.api.queryAllColumns, {
platformId: Setting.platformId, school: 0
page: 1,
size: 1000
}).then(res => { }).then(res => {
this.menuList = res.columnTree; this.menuList = res.columnTree;
if (this.menuList.length) { if (this.menuList.length) {
this.getId(this.menuList)
if (this.menuList[0].children && this.menuList[0].children.length) { if (this.menuList[0].children && this.menuList[0].children.length) {
this.columnId = this.menuList[0].children[0].id; this.columnId = this.menuList[0].children[0].id;
} else { } else {
this.columnId = this.menuList[0].id; this.columnId = this.menuList[0].id;
} }
if (!this.$store.state.info.columnId) { if (!this.$store.state.columnId) {
this.$store.commit('setColumnId', this.columnId) this.$store.commit('setColumnId', this.columnId)
} else { } else {
this.columnId = this.$store.state.info.columnId; this.columnId = this.$store.state.columnId;
} }
} }
}).catch(err => { }).catch(err => {
}); });
}, },
handleSelect(key, keyPath) { // id便
getId(data) {
data.map(e => {
this.ids.push(e.id)
e.children.length && this.getId(e.children)
})
},
menuClick(key) {
this.curId = key
console.log("🚀 ~ file: index.vue ~ line 76 ~ menuClick ~ this.curId", this.curId)
this.handleSelect(key)
},
handleSelect(key) {
this.columnId = key; this.columnId = key;
this.$store.commit('setColumnId', key); this.$store.commit('setColumnId', key);
} }
@ -75,17 +86,18 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.menu-con { .menu-con {
// width: 210px;
height: calc(100vh - 250px); height: calc(100vh - 250px);
border-right: solid 1px #e6e6e6; border-right: solid 1px #e6e6e6;
background-color: #F2F6FC; background-color: #F2F6FC;
// overflow: hidden;
.el-menu { .el-menu {
background-color: transparent; background-color: transparent;
.el-submenu { .el-submenu {
background-color: transparent; background-color: transparent;
&.is-active {
color: #9076FF;
}
} }
.el-menu-item.is-active { .el-menu-item.is-active {
@ -94,4 +106,7 @@ export default {
} }
} }
} }
.right {
flex: 1;
}
</style> </style>

@ -943,6 +943,7 @@ export default {
let list = orderOther.map(e => { let list = orderOther.map(e => {
const now = Date.now() const now = Date.now()
const item = renewList.find(n => n.dataOrCourseId === e.dataOrCourseId && n.authority === e.authority) // renew const item = renewList.find(n => n.dataOrCourseId === e.dataOrCourseId && n.authority === e.authority) // renew
console.log("🚀 ~ file: AddOrder.vue ~ line 946 ~ list ~ item", item)
// if (item) { // if (item) {
// //
const cur = item || e const cur = item || e
@ -964,6 +965,9 @@ export default {
e.endTime = cur.endTime.split(" ")[0]; e.endTime = cur.endTime.split(" ")[0];
} }
// } // }
if (item) {
e.marketValue = item.marketValue
}
const startTime = new Date(e.startTime) const startTime = new Date(e.startTime)
const endTime = new Date(e.endTime) const endTime = new Date(e.endTime)
// 1: 23 // 1: 23
@ -976,6 +980,7 @@ export default {
return e; return e;
});// });//
this.coursePermissions = list.filter(i => i.authority === 1); this.coursePermissions = list.filter(i => i.authority === 1);
console.log("🚀 ~ file: AddOrder.vue ~ line 979 ~ setStartDate ~ this.coursePermissions ", this.coursePermissions )
this.dataPlatformPermissions = list.filter(i => i.authority === 0); this.dataPlatformPermissions = list.filter(i => i.authority === 0);
}, },
// //

@ -54,7 +54,7 @@
</el-select> </el-select>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="可见范围"> <el-form-item prop="visibleRange" label="可见范围">
<div> <div>
<el-radio v-model="form.visibleRange" :label="1">全平台</el-radio> <el-radio v-model="form.visibleRange" :label="1">全平台</el-radio>
</div> </div>
@ -64,7 +64,7 @@
<span style="margin-left: 20px">{{ rangeName }}</span> <span style="margin-left: 20px">{{ rangeName }}</span>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="课程介绍"> <el-form-item prop="courseIntroduction" label="课程介绍">
<quill :border="true" :readonly="isDetail" v-model="form.courseIntroduction" :height="400" /> <quill :border="true" :readonly="isDetail" v-model="form.courseIntroduction" :height="400" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
@ -142,6 +142,15 @@ export default {
], ],
coverUrl: [ coverUrl: [
{ required: true, message: '请选择课程封面', trigger: 'change' } { required: true, message: '请选择课程封面', trigger: 'change' }
],
courseType: [
{ required: true, message: '请选择课程类型', trigger: 'change' }
],
visibleRange: [
{ required: true, message: '请选择可见范围', trigger: 'change' }
],
courseIntroduction: [
{ required: true, message: '请输入课程介绍', trigger: 'blur' }
] ]
}, },
classificationList: [], classificationList: [],
@ -261,6 +270,17 @@ export default {
delete data.platformClassificationList delete data.platformClassificationList
} }
this.form = data this.form = data
// name
const rangeName = data.courseRangeList
if (rangeName) {
const range = []
rangeName.map(e => {
range.push(e.type ? (e.cityName || e.provinceName) : e.schoolName)
})
this.rangeName = range.join(',')
}
this.uploadList.push({ this.uploadList.push({
name: "cover.jpg", name: "cover.jpg",
url: data.coverUrl url: data.coverUrl
@ -416,6 +436,7 @@ export default {
const { form } = this const { form } = this
this.submiting = true this.submiting = true
if (form.id) { if (form.id) {
form.courseId = form.id
this.$post(this.api.updateTheoreticalCourse, form).then(res => { this.$post(this.api.updateTheoreticalCourse, form).then(res => {
this.submiting = false; this.submiting = false;
util.successMsg("修改成功"); util.successMsg("修改成功");
@ -424,14 +445,14 @@ export default {
this.submiting = false; this.submiting = false;
}); });
} else { } else {
this.$post(this.api.saveTheoreticalCourse, form).then(res => { this.$post(this.api.saveTheoreticalCourse, form).then(({ courseId }) => {
this.submiting = false; this.submiting = false;
this.$confirm("课程创建成功,是否马上进行课程内容设置?", "提示", { this.$confirm("课程创建成功,是否马上进行课程内容设置?", "提示", {
type: "success", type: "success",
confirmButtonText: "马上设置", confirmButtonText: "马上设置",
cancelButtonText: "稍后操作" cancelButtonText: "稍后操作"
}).then(() => { }).then(() => {
this.$router.push(`/setTheoreticalCourse?id=${res.id}`); this.$router.replace(`/setTheoreticalCourse?id=${courseId}`);
}).catch(() => { }).catch(() => {
this.$router.back(); this.$router.back();
}); });

@ -2,7 +2,7 @@
<div> <div>
<el-card shadow="hover" class="m-b-20"> <el-card shadow="hover" class="m-b-20">
<div class="flex-between"> <div class="flex-between">
<el-page-header @back="goBack" :content="sorting? '更改排序' : '内容设置'"></el-page-header> <el-page-header @back="goBack" :content="'课程内容/' + (sorting ? '更改排序' : '内容设置')"></el-page-header>
</div> </div>
</el-card> </el-card>
<!--内容设置--> <!--内容设置-->
@ -12,13 +12,13 @@
<div class="p-title">内容设置</div> <div class="p-title">内容设置</div>
<div class="btns" style="top: -10px"> <div class="btns" style="top: -10px">
<template v-if="!sorting"> <template v-if="!sorting">
<el-button v-auth="'/course/list:课程管理:内容设置:添加章节'" type="primary" round v-throttle @click="addChapter">添加章节</el-button> <el-button v-auth="'/course/list:课程管理:内容设置:添加章节'" type="primary" round @click="addChapter">添加章节</el-button>
<el-button v-auth="'/course/list:课程管理:内容设置:编辑顺序'" type="primary" round v-throttle @click="sort">编辑顺序</el-button> <el-button v-auth="'/course/list:课程管理:内容设置:编辑顺序'" type="primary" round @click="sort">编辑顺序</el-button>
</template> </template>
<template v-else> <template v-else>
<el-button type="primary" round @click="move">批量移动</el-button> <el-button type="primary" round @click="move">批量移动</el-button>
<el-button type="primary" round v-throttle @click="cancelSort">取消</el-button> <el-button type="primary" round @click="cancelSort">取消</el-button>
<el-button type="primary" round v-throttle @click="saveSort">保存</el-button> <el-button type="primary" round @click="saveSort">保存</el-button>
</template> </template>
</div> </div>
</div> </div>
@ -29,9 +29,9 @@
<div>{{ chapter.name }}</div> <div>{{ chapter.name }}</div>
<div> <div>
<template v-if="!sorting"> <template v-if="!sorting">
<el-button v-auth="'/course/list:课程管理:内容设置:修改章节名称'" class="action-btn" type="primary" round v-throttle @click="editChapter(chapter)">修改章节名称</el-button> <el-button v-auth="'/course/list:课程管理:内容设置:修改章节名称'" class="action-btn" type="primary" round @click="editChapter(chapter)">修改章节名称</el-button>
<el-button v-auth="'/course/list:课程管理:内容设置:添加小节'" class="action-btn" type="primary" round v-throttle @click="addSection(chapter.id)">添加小节</el-button> <el-button v-auth="'/course/list:课程管理:内容设置:添加小节'" class="action-btn" type="primary" round @click="addSection(chapter.id)">添加小节</el-button>
<el-button v-auth="'/course/list:课程管理:内容设置:章节删除'" class="action-btn" type="primary" round v-throttle @click="delChapter(chapter.id)">删除</el-button> <el-button v-auth="'/course/list:课程管理:内容设置:章节删除'" class="action-btn" type="primary" round @click="delChapter(chapter.id)">删除</el-button>
</template> </template>
<template v-else> <template v-else>
<i class="el-icon-top sort-icon" :class="{disabled: index == 0}" style="margin-right: 5px" @click="sortChapter(chapter,'up',index == 0,index)"></i> <i class="el-icon-top sort-icon" :class="{disabled: index == 0}" style="margin-right: 5px" @click="sortChapter(chapter,'up',index == 0,index)"></i>
@ -97,10 +97,12 @@
:action="this.api.fileupload" :action="this.api.fileupload"
:file-list="uploadList" :file-list="uploadList"
:headers="headers" :headers="headers"
:http-request="handleRequest"
name="file" name="file"
> >
<el-button size="small"><img src="@/assets/img/upload.png" alt=""> 上传资源</el-button> <el-button size="small"><img src="@/assets/img/upload.png" alt=""> 上传资源</el-button>
</el-upload> </el-upload>
<el-progress v-if="showProgress" :stroke-width="3" :percentage="progressPercent"></el-progress>
</el-form-item> </el-form-item>
<el-form-item label="小节名称"> <el-form-item label="小节名称">
<el-input placeholder="请输入小节名称" v-model="sectionName" maxlength="50"></el-input> <el-input placeholder="请输入小节名称" v-model="sectionName" maxlength="50"></el-input>
@ -125,10 +127,12 @@
:action="this.api.fileupload" :action="this.api.fileupload"
:file-list="uploadList" :file-list="uploadList"
:headers="headers" :headers="headers"
:http-request="handleRequest"
name="file" name="file"
> >
<el-button size="small"><img src="@/assets/img/upload.png" alt=""> 上传资源</el-button> <el-button size="small"><img src="@/assets/img/upload.png" alt=""> 上传资源</el-button>
</el-upload> </el-upload>
<el-progress v-if="showProgress" :stroke-width="3" :percentage="progressPercent"></el-progress>
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="switchVisible = false">取消</el-button> <el-button @click="switchVisible = false">取消</el-button>
@ -211,13 +215,14 @@ import util from "@/libs/util";
import Setting from "@/setting"; import Setting from "@/setting";
import { Loading } from "element-ui"; import { Loading } from "element-ui";
import pdf from "@/components/pdf"; import pdf from "@/components/pdf";
import axios from 'axios'
export default { export default {
name: "contentSettings", name: "contentSettings",
data() { data() {
return { return {
headers: { headers: {
token: util.local.get(Setting.tokenKey) token: sessionStorage.getItem("token")
}, },
id: "", id: "",
originChapters: [], originChapters: [],
@ -253,6 +258,8 @@ export default {
loadIns: null, loadIns: null,
pdfVisible: false, pdfVisible: false,
pdfSrc: "", pdfSrc: "",
showProgress: false,
progressPercent: 0,
previewing: false, previewing: false,
moveVisible: false, moveVisible: false,
checkList: [], checkList: [],
@ -289,7 +296,7 @@ export default {
}, },
methods: { methods: {
getData() { getData() {
this.$get(`${this.api.queryChaptersAndSubsections}/${this.id}`) this.$get(`${this.api.queryChaptersTheoretical}?courseId=${this.id}`)
.then(res => { .then(res => {
this.chapters = res.chapterList; this.chapters = res.chapterList;
}) })
@ -365,12 +372,42 @@ export default {
this.originalFileName = file.name; this.originalFileName = file.name;
if (this.isAddSection) this.sectionName = file.name.substring(0, file.name.lastIndexOf(".")); if (this.isAddSection) this.sectionName = file.name.substring(0, file.name.lastIndexOf("."));
this.fileType = file.name.substring(file.name.lastIndexOf(".") + 1); this.fileType = file.name.substring(file.name.lastIndexOf(".") + 1);
this.showProgress = true
}, },
handleExceed(files, fileList) { handleExceed(files, fileList) {
util.warningMsg( util.warningMsg(
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!` `当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
); );
}, },
//
handleRequest(data) {
const param = new FormData()
param.append('file', data.file)
const config = {
timeout: 10000000000,
headers: {
'Accept': '*/*',
'Content-Type': 'multipart/form-data',
token: sessionStorage.getItem("token")
},
//
onUploadProgress: progressEvent => {
const per = Number((progressEvent.loaded / progressEvent.total * 100).toFixed(2))
console.log("🚀 ~ file: contentSettings.vue ~ line 329 ~ handleRequest ~ per", per, this.progressPercent)
if (this.progressPercent <= 80) this.progressPercent = (per > 80) ? (Math.random() * 10 + 80).toFixed(2) : per
}
}
axios.post(this.api.fileupload, param, config).then(res => {
this.progressPercent = 100
this.showProgress = false
const { fileId, fileType, fileUrl, ossFileName } = res.data.data.filesResult
this.uploading = false
this.fileId = fileId
this.fileType = fileType
this.fileUrl = fileUrl
this.fileName = ossFileName
})
},
uploadSuccess(res, file, fileList) { uploadSuccess(res, file, fileList) {
this.uploading = false; this.uploading = false;
this.fileId = res.data.filesResult.fileId; this.fileId = res.data.filesResult.fileId;
@ -510,7 +547,7 @@ export default {
let data = { let data = {
chapterVOList: this.chapters chapterVOList: this.chapters
}; };
this.$post(this.api.reorder, data).then(res => { this.$post(this.api.reorderTheoretical, data).then(res => {
this.sorting = false; this.sorting = false;
}).catch(res => { }).catch(res => {
}); });
@ -525,7 +562,7 @@ export default {
type: "warning" type: "warning"
}) })
.then(() => { .then(() => {
this.$del(`${this.api.deleteChapter}/${id}`).then(res => { this.$del(`${this.api.deleteChapterTheoretical}?chapterId=${id}`).then(res => {
util.successMsg("删除成功"); util.successMsg("删除成功");
this.getData(); this.getData();
}).catch(res => { }).catch(res => {
@ -554,7 +591,7 @@ export default {
}; };
if (this.chapterId) { if (this.chapterId) {
data.id = this.chapterId; data.id = this.chapterId;
this.$put(this.api.editChapter, data).then(res => { this.$put(this.api.editChapterTheoretical, data).then(res => {
util.successMsg("修改成功"); util.successMsg("修改成功");
this.chapterVisible = false; this.chapterVisible = false;
this.getData(); this.getData();
@ -562,7 +599,7 @@ export default {
.catch(err => { .catch(err => {
}); });
} else { } else {
this.$post(this.api.addChapter, data).then(res => { this.$post(this.api.addChapterTheoretical, data).then(res => {
util.successMsg("添加成功"); util.successMsg("添加成功");
this.chapterVisible = false; this.chapterVisible = false;
this.getData(); this.getData();
@ -586,7 +623,7 @@ export default {
fileType: this.fileType, fileType: this.fileType,
originalFileName: this.originalFileName originalFileName: this.originalFileName
}; };
this.$post(this.api.addSubsection, data).then(res => { this.$post(this.api.addSubsectionTheoretical, data).then(res => {
util.successMsg("添加成功"); util.successMsg("添加成功");
this.sectionVisible = false; this.sectionVisible = false;
this.getData(); this.getData();
@ -625,7 +662,7 @@ export default {
this.pdfSrc = row.fileUrl; this.pdfSrc = row.fileUrl;
this.pdfVisible = true; this.pdfVisible = true;
} else { } else {
this.$get(`${this.api.getSubsection}/${row.id}`).then(res => { this.$get(`${this.api.getSubsectionTheoretical}?subsectionId=${row.id}`).then(res => {
this.previewing = true; this.previewing = true;
this.loadIns = Loading.service(); this.loadIns = Loading.service();
this.$route.fullPath.includes("#file") || history.pushState({ file: true }, "文件预览", "#" + this.$route.fullPath + "#file"); this.$route.fullPath.includes("#file") || history.pushState({ file: true }, "文件预览", "#" + this.$route.fullPath + "#file");
@ -687,7 +724,7 @@ export default {
fileUrl: this.fileUrl, fileUrl: this.fileUrl,
originalFileName: this.originalFileName originalFileName: this.originalFileName
}; };
this.$put(this.api.editSubsection, data).then(res => { this.$put(this.api.editSubsectionTheoretical, data).then(res => {
util.successMsg("更换成功"); util.successMsg("更换成功");
this.switchVisible = false; this.switchVisible = false;
this.getData(); this.getData();
@ -718,7 +755,7 @@ export default {
type: "warning" type: "warning"
}) })
.then(() => { .then(() => {
this.$del(`${this.api.deleteSubsection}/${row.id}`).then(res => { this.$del(`${this.api.deleteSubsectionTheoretical}?subsectionId=${row.id}`).then(res => {
util.successMsg("删除成功"); util.successMsg("删除成功");
this.getData(); this.getData();
}).catch(res => { }).catch(res => {
@ -761,7 +798,7 @@ export default {
chapterId: this.chapterId, chapterId: this.chapterId,
name: this.sectionName name: this.sectionName
}; };
this.$put(this.api.editSubsection, data).then(res => { this.$put(this.api.editSubsectionTheoretical, data).then(res => {
util.successMsg("修改成功"); util.successMsg("修改成功");
this.sectionNameVisible = false; this.sectionNameVisible = false;
this.getData(); this.getData();
@ -785,13 +822,16 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.relative {
position: relative;
}
.btns { .btns {
position: absolute; position: absolute;
top: 12px; top: 12px;
right: 24px; right: 24px;
.el-button { .el-button {
font-size: 14px; font-size: 12px;
} }
} }
/deep/.el-progress-bar { /deep/.el-progress-bar {
@ -807,7 +847,9 @@ export default {
cursor: not-allowed cursor: not-allowed
} }
} }
/deep/.el-upload-list__item-status-label {
// display: inline-block;
}
.el-image-viewer__wrapper { .el-image-viewer__wrapper {
transform: translateY(-10px); transform: translateY(-10px);
transition: transform .5s; transition: transform .5s;

@ -13,6 +13,7 @@
<label>课程分类</label> <label>课程分类</label>
<el-select v-model="form.categoryId" clearable placeholder="请选择课程分类" @change="getData"> <el-select v-model="form.categoryId" clearable placeholder="请选择课程分类" @change="getData">
<el-option label="不限" value=""></el-option> <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-option v-for="(item,index) in classificationList" :key="index" :label="item.classificationName" :value="item.id"></el-option>
</el-select> </el-select>
</li> </li>
@ -40,23 +41,23 @@
{{ scope.$index + (page - 1) * pageSize + 1 }} {{ scope.$index + (page - 1) * pageSize + 1 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="courseName" label="课程名称"> <el-table-column prop="courseName" label="课程名称" align="center">
</el-table-column> </el-table-column>
<el-table-column label="可见范围"> <el-table-column label="可见范围" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ regionName[scope.row.visibleRange] }} {{ regionName[scope.row.visibleRange] }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="createTime" label="创建时间"> <el-table-column prop="createTime" label="创建时间" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="courseClassification" label="课程类型"> <el-table-column prop="courseClassification" label="课程类型" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.courseType == 1 ? '付费' : '免费' }} {{ scope.row.courseType == 1 ? '付费' : '免费' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="founder" label="创建人"> <el-table-column prop="founder" label="创建人" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="courseClassification" label="课程分类"> <el-table-column prop="courseClassification" label="课程分类" align="center" show-overflow-tooltip>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="250"> <el-table-column label="操作" align="center" width="250">
<template slot-scope="scope"> <template slot-scope="scope">
@ -94,9 +95,9 @@
import util from "@/libs/util"; import util from "@/libs/util";
import Setting from '@/setting' import Setting from '@/setting'
export default { export default {
name: "courseManagement",
data() { data() {
return { return {
timer: null,
regionName: ['本校内', '全平台可见', '指定院校区域'], regionName: ['本校内', '全平台可见', '指定院校区域'],
regions: [ regions: [
{ {
@ -152,9 +153,16 @@ export default {
mounted() { mounted() {
this.getClassification(); this.getClassification();
this.getData(); this.getData();
this.$once('hook:beforeDestroy', function() {
clearInterval(this.timer)
})
}, },
methods: { methods: {
getData() { //:
//
// 使
//1.
getList() {
this.$post(this.api.listTheoreticalCourse, { this.$post(this.api.listTheoreticalCourse, {
pageNum: this.page, pageNum: this.page,
pageSize: this.pageSize, pageSize: this.pageSize,
@ -172,6 +180,19 @@ export default {
}).catch(res => { }).catch(res => {
}); });
}, },
// redis
getRedis() {
this.$post(this.api.getRedisCache).then(({ data }) => {
data && this.getList()
}).catch(res => {})
},
getData() {
this.getList()
if (!Setting.isDev) {
clearInterval(this.timer)
this.timer = setInterval(this.getRedis, 1000)
}
},
initData() { initData() {
this.page = 1; this.page = 1;
this.getData(); this.getData();

@ -13,7 +13,7 @@
<label>课程分类</label> <label>课程分类</label>
<el-select v-model="form.categoryId" clearable placeholder="请选择课程分类" @change="getData"> <el-select v-model="form.categoryId" clearable placeholder="请选择课程分类" @change="getData">
<el-option label="不限" value=""></el-option> <el-option label="不限" value=""></el-option>
<el-option v-for="(item,index) in classificationList" :key="index" :label="item.classificationName" :value="item.id"></el-option> <el-option v-for="(item,index) in classificationList" :key="index" :label="item.typeName" :value="item.id"></el-option>
</el-select> </el-select>
</li> </li>
<li> <li>
@ -40,23 +40,23 @@
{{ scope.$index + (page - 1) * pageSize + 1 }} {{ scope.$index + (page - 1) * pageSize + 1 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="courseName" label="课程名称"> <el-table-column prop="courseName" label="课程名称" align="center">
</el-table-column> </el-table-column>
<el-table-column label="可见范围"> <el-table-column label="可见范围" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ regionName[scope.row.visibleRange] }} {{ regionName[scope.row.visibleRange] }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="createTime" label="创建时间"> <el-table-column prop="createTime" label="创建时间" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="courseClassification" label="课程类型"> <el-table-column prop="courseClassification" label="课程类型" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.courseType == 1 ? '付费' : '免费' }} {{ scope.row.courseType == 1 ? '付费' : '免费' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="founder" label="创建人"> <el-table-column prop="founder" label="创建人" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="courseClassification" label="课程分类"> <el-table-column prop="courseClassification" label="课程分类" align="center" show-overflow-tooltip>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="250"> <el-table-column label="操作" align="center" width="250">
<template slot-scope="scope"> <template slot-scope="scope">
@ -94,9 +94,9 @@
import util from "@/libs/util"; import util from "@/libs/util";
import Setting from '@/setting' import Setting from '@/setting'
export default { export default {
name: "courseManagement",
data() { data() {
return { return {
timer: null,
regionName: ['本校内', '全平台可见', '指定院校区域'], regionName: ['本校内', '全平台可见', '指定院校区域'],
regions: [ regions: [
{ {
@ -152,9 +152,16 @@ export default {
mounted() { mounted() {
this.getClassification(); this.getClassification();
this.getData(); this.getData();
this.$once('hook:beforeDestroy', function() {
clearInterval(this.timer)
})
}, },
methods: { methods: {
getData() { //:
//
// 使
//1.
getList() {
this.$post(this.api.listTheoreticalCourse, { this.$post(this.api.listTheoreticalCourse, {
pageNum: this.page, pageNum: this.page,
pageSize: this.pageSize, pageSize: this.pageSize,
@ -172,17 +179,31 @@ export default {
}).catch(res => { }).catch(res => {
}); });
}, },
// redis
getRedis() {
this.$post(this.api.getRedisCache).then(({ data }) => {
data && this.getList()
}).catch(res => {})
},
getData() {
this.getList()
if (!Setting.isDev) {
clearInterval(this.timer)
this.timer = setInterval(this.getRedis, 1000)
}
},
initData() { initData() {
this.page = 1; this.page = 1;
this.getData(); this.getData();
}, },
getClassification() { getClassification() {
this.$post(this.api.listClassification, { this.$post(this.api.queryAllCategoriesOfSchools).then(({ data }) => {
pageNum: 1, data.map((e, i) => {
pageSize: 1000, const name = e.classificationName
platformSource: 1 e.typeName = name
}).then(({ page }) => { if (data.filter((n, j) => n.classificationName === name).length > 1) e.typeName = name + '(' + e.schoolName + ')'
this.classificationList = page.records })
this.classificationList = data
}).catch(res => {}) }).catch(res => {})
}, },
changeType(type) { changeType(type) {
@ -245,40 +266,14 @@ export default {
this.page = val; this.page = val;
this.getData(); this.getData();
}, },
disable(val, row) { switchOff(val, row) {
this.$post(this.api.disabledTheoreticalCourse, {
courseId: row.id,
isOpen: val,
type: 0 // (01)
}).then(res => {
val == 1 ? util.warningMsg('禁用成功') : util.successMsg('启用成功')
}).catch(err => {})
},
switchOff(val, row, index) {
if (val) {
this.disable(val, row)
} else if (!row.publishStatus) {
this.$confirm('是否发布该课程?', '提示', {
type: 'success'
}).then(() => {
this.$post(this.api.disabledTheoreticalCourse, { this.$post(this.api.disabledTheoreticalCourse, {
courseId: row.id, courseId: row.id,
isOpen: val, isOpen: val,
type: 0 // (01) type: 0 // (01)
}).then(res => { }).then(res => {
row.courseId = row.id
row.publishStatus = 1
this.$post(this.api.updateTheoreticalCourse, row).then(res => {
this.getData()
val == 1 ? util.warningMsg('禁用成功') : util.successMsg('启用成功') val == 1 ? util.warningMsg('禁用成功') : util.successMsg('启用成功')
}).catch(err => {}) }).catch(err => {})
}).catch(err => {})
}).catch(() => {
row.ztOpen = 1
})
} else {
this.disable(val, row)
}
} }
} }
}; };

@ -90,7 +90,7 @@ export default {
type: "warning" type: "warning"
}) })
.then(() => { .then(() => {
this.$post(`${this.api.delClassification}?id=${row.id}`).then(res => { this.$post(this.api.delClassification, [row.id]).then(res => {
util.successMsg("删除成功"); util.successMsg("删除成功");
this.getData(); this.getData();
}).catch(res => { }).catch(res => {

@ -125,13 +125,13 @@ export default {
this.$router.back(); this.$router.back();
}, },
async getData() { async getData() {
let res = await this.$get(`${this.api.getCourse}/${this.id}`); let res = await this.$post(`${this.api.findTheoreticalCourse}?id=${this.id}`);
this.courseName = res.course.name; this.courseName = res.data.courseName;
this.description = res.course.description; this.description = res.data.courseIntroduction;
this.coverUrl = res.course.coverUrl; this.coverUrl = res.data.coverUrl;
}, },
async getChapter() { async getChapter() {
let res = await this.$get(`${this.api.queryChaptersAndSubsections}/${this.id}`); let res = await this.$get(`${this.api.queryChapters}?courseId=${this.id}`);
this.videoList = res.chapterList; this.videoList = res.chapterList;
}, },
insertScript() { insertScript() {
@ -183,7 +183,7 @@ export default {
this.pdfSrc = row.fileUrl; this.pdfSrc = row.fileUrl;
this.pdfVisible = true; this.pdfVisible = true;
} else { } else {
this.$get(`${this.api.getSubsection}/${row.id}`).then(res => { this.$get(`${this.api.getSubsection}?subsectionId=${row.id}`).then(res => {
if (row.fileType == "pptx") { if (row.fileType == "pptx") {
this.isPPT = true; this.isPPT = true;
this.isWord = false; this.isWord = false;
@ -293,6 +293,7 @@ $height: 700px;
} }
.catalog { .catalog {
flex: 1;
margin-left: 40px; margin-left: 40px;
} }

Loading…
Cancel
Save