课程等修复

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. 146
      src/views/information/addArticle/index.vue
  8. 65
      src/views/information/columnManage/index.vue
  9. 2
      src/views/information/contentManage/contentList.vue
  10. 105
      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;
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 {
-webkit-transition: left .3s ease-in-out;
transition: left .3s ease-in-out;

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

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

@ -155,29 +155,43 @@ export default {
updateTheoreticalCourse: `occupationlab/occupationlab/theoreticalCourse/update`,
disabledTheoreticalCourse: `occupationlab/occupationlab/theoreticalCourse/disabledEvents`,
checkRepeatTheoreticalCourse: `occupationlab/occupationlab/theoreticalCourse/checkRepeat`,
getRedisCache: `occupationlab/occupationlab/theoreticalCourse/getRedisCache`,
// 理论课程分类管理
checkRepeatClassification: `occupationlab/occupationlab/theoreticalCourseClassification/checkRepeat`,
delClassification: `occupationlab/occupationlab/theoreticalCourseClassification/delete`,
delClassification: `occupationlab/occupationlab/theoreticalCourseClassification/batchDeletion`,
findClassification: `occupationlab/occupationlab/theoreticalCourseClassification/findById`,
listClassification: `occupationlab/occupationlab/theoreticalCourseClassification/pagingQuery`,
saveClassification: `occupationlab/occupationlab/theoreticalCourseClassification/save`,
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`,
deleteColumn: `${host1}occupationlab/occupationlab/information/column/deleteColumn`,
editColumn: `${host1}occupationlab/occupationlab/information/column/editColumn`,
queryAllColumns: `${host1}occupationlab/occupationlab/information/column/queryAllColumns`,
columnReorder: `${host1}occupationlab/occupationlab/information/column/reorder`,
addColumn: `occupationlab/occupationlab/information/column/addColumn`,
deleteColumn: `occupationlab/occupationlab/information/column/deleteColumn`,
editColumn: `occupationlab/occupationlab/information/column/editColumn`,
queryAllColumns: `occupationlab/occupationlab/information/column/queryAllColumns`,
columnReorder: `occupationlab/occupationlab/information/column/reorder`,
// 内容管理
addArticle: `${host1}occupationlab/occupationlab/information/article/addArticle`,
deleteArticles: `${host1}occupationlab/occupationlab/information/article/deleteArticles`,
editArticle: `${host1}occupationlab/occupationlab/information/article/editArticle`,
enableArticle: `${host1}occupationlab/occupationlab/information/article/enableArticle`,
getArticle: `${host1}occupationlab/occupationlab/information/article/getArticle`,
getArticles: `${host1}occupationlab/occupationlab/information/article/getArticles`,
queryArticleByCondition: `${host1}occupationlab/occupationlab/information/article/queryArticleByCondition`,
articleSort: `${host1}occupationlab/occupationlab/information/article/articleSort`,
addArticle: `occupationlab/occupationlab/information/article/addArticle`,
deleteArticles: `occupationlab/occupationlab/information/article/deleteArticles`,
editArticle: `occupationlab/occupationlab/information/article/editArticle`,
enableArticle: `occupationlab/occupationlab/information/article/enableArticle`,
getArticle: `occupationlab/occupationlab/information/article/getArticle`,
getArticles: `occupationlab/occupationlab/information/article/getArticles`,
queryArticleByCondition: `occupationlab/occupationlab/information/article/queryArticleByCondition`,
articleSort: `occupationlab/occupationlab/information/article/articleSort`,
// 阿里云文件/视频管理
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>
<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">
<el-checkbox v-model="item.check" :label="item.projectName" @change="val => projectChange(val, item)"></el-checkbox>
</li>
@ -619,6 +619,7 @@ export default {
list.map(e => {
//
// if (!checked.find(n => n.systemId == e.systemId)) {
// e.check = !!checked.find(n => n.systemId == e.systemId)
e.check = false
result.push(e)
// }
@ -641,6 +642,7 @@ export default {
e.check = include
result.push(e)
})
this.checkAll = !result.filter(e => !e.check).length
this.projects = result
}).catch(err => {})
},
@ -677,6 +679,13 @@ export default {
this.checkedAll = JSON.parse(JSON.stringify(checkeds)) //
}).catch(err => {})
},
//
checkAllChange(val, systemId) {
this.systemChange(val, { systemId })
this.systems.map(e => {
if (e.systemId == systemId) e.check = val
})
},
//
projectChange(val, item) {
const { systemId } = item
@ -685,12 +694,13 @@ export default {
if (val) {
this.checkeds.push(item)
} else if (i !== -1) {
this.systems.map(e => {
if (e.systemId == systemId) e.check = false
})
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)) //
},
//
@ -712,7 +722,11 @@ export default {
n.check = false
}
})
this.checkAll = !this.projects.find(e => !e.check)
}
this.systems.map(n => {
if (n.systemId == e.systemId) n.check = false
})
}).catch(() => {})
},
//

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

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

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

@ -16,7 +16,7 @@
{{ scope.$index + (pageNo - 1) * pageSize + 1 }}
</template>
</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 prop="name" label="排序值" width="80" align="center">
<template slot-scope="scope">

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

@ -943,6 +943,7 @@ export default {
let list = orderOther.map(e => {
const now = Date.now()
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) {
//
const cur = item || e
@ -964,6 +965,9 @@ export default {
e.endTime = cur.endTime.split(" ")[0];
}
// }
if (item) {
e.marketValue = item.marketValue
}
const startTime = new Date(e.startTime)
const endTime = new Date(e.endTime)
// 1: 23
@ -976,6 +980,7 @@ export default {
return e;
});//
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);
},
//

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

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

@ -13,6 +13,7 @@
<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>
</li>
@ -40,23 +41,23 @@
{{ scope.$index + (page - 1) * pageSize + 1 }}
</template>
</el-table-column>
<el-table-column prop="courseName" label="课程名称">
<el-table-column prop="courseName" label="课程名称" align="center">
</el-table-column>
<el-table-column label="可见范围">
<el-table-column label="可见范围" align="center">
<template slot-scope="scope">
{{ regionName[scope.row.visibleRange] }}
</template>
</el-table-column>
<el-table-column prop="createTime" label="创建时间">
<el-table-column prop="createTime" label="创建时间" align="center">
</el-table-column>
<el-table-column prop="courseClassification" label="课程类型">
<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="创建人">
<el-table-column prop="founder" label="创建人" align="center">
</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 label="操作" align="center" width="250">
<template slot-scope="scope">
@ -94,9 +95,9 @@
import util from "@/libs/util";
import Setting from '@/setting'
export default {
name: "courseManagement",
data() {
return {
timer: null,
regionName: ['本校内', '全平台可见', '指定院校区域'],
regions: [
{
@ -152,9 +153,16 @@ export default {
mounted() {
this.getClassification();
this.getData();
this.$once('hook:beforeDestroy', function() {
clearInterval(this.timer)
})
},
methods: {
getData() {
//:
//
// 使
//1.
getList() {
this.$post(this.api.listTheoreticalCourse, {
pageNum: this.page,
pageSize: this.pageSize,
@ -172,6 +180,19 @@ export default {
}).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() {
this.page = 1;
this.getData();

@ -13,7 +13,7 @@
<label>课程分类</label>
<el-select v-model="form.categoryId" clearable placeholder="请选择课程分类" @change="getData">
<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>
</li>
<li>
@ -40,23 +40,23 @@
{{ scope.$index + (page - 1) * pageSize + 1 }}
</template>
</el-table-column>
<el-table-column prop="courseName" label="课程名称">
<el-table-column prop="courseName" label="课程名称" align="center">
</el-table-column>
<el-table-column label="可见范围">
<el-table-column label="可见范围" align="center">
<template slot-scope="scope">
{{ regionName[scope.row.visibleRange] }}
</template>
</el-table-column>
<el-table-column prop="createTime" label="创建时间">
<el-table-column prop="createTime" label="创建时间" align="center">
</el-table-column>
<el-table-column prop="courseClassification" label="课程类型">
<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="创建人">
<el-table-column prop="founder" label="创建人" align="center">
</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 label="操作" align="center" width="250">
<template slot-scope="scope">
@ -94,9 +94,9 @@
import util from "@/libs/util";
import Setting from '@/setting'
export default {
name: "courseManagement",
data() {
return {
timer: null,
regionName: ['本校内', '全平台可见', '指定院校区域'],
regions: [
{
@ -152,9 +152,16 @@ export default {
mounted() {
this.getClassification();
this.getData();
this.$once('hook:beforeDestroy', function() {
clearInterval(this.timer)
})
},
methods: {
getData() {
//:
//
// 使
//1.
getList() {
this.$post(this.api.listTheoreticalCourse, {
pageNum: this.page,
pageSize: this.pageSize,
@ -172,17 +179,31 @@ export default {
}).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() {
this.page = 1;
this.getData();
},
getClassification() {
this.$post(this.api.listClassification, {
pageNum: 1,
pageSize: 1000,
platformSource: 1
}).then(({ page }) => {
this.classificationList = page.records
this.$post(this.api.queryAllCategoriesOfSchools).then(({ data }) => {
data.map((e, i) => {
const name = e.classificationName
e.typeName = name
if (data.filter((n, j) => n.classificationName === name).length > 1) e.typeName = name + '(' + e.schoolName + ')'
})
this.classificationList = data
}).catch(res => {})
},
changeType(type) {
@ -245,7 +266,7 @@ export default {
this.page = val;
this.getData();
},
disable(val, row) {
switchOff(val, row) {
this.$post(this.api.disabledTheoreticalCourse, {
courseId: row.id,
isOpen: val,
@ -253,32 +274,6 @@ export default {
}).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, {
courseId: row.id,
isOpen: val,
type: 0 // (01)
}).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('启用成功')
}).catch(err => {})
}).catch(err => {})
}).catch(() => {
row.ztOpen = 1
})
} else {
this.disable(val, row)
}
}
}
};

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

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

Loading…
Cancel
Save