diff --git a/src/assets/css/main.css b/src/assets/css/main.css
index a365a94..5678e7e 100644
--- a/src/assets/css/main.css
+++ b/src/assets/css/main.css
@@ -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;
diff --git a/src/components/menuTree/index.vue b/src/components/menuTree/index.vue
index 648e2f8..74348f8 100644
--- a/src/components/menuTree/index.vue
+++ b/src/components/menuTree/index.vue
@@ -1,9 +1,10 @@
+
- {{item.name}}
+ {{item.name}}
@@ -21,6 +22,9 @@
menuList: {
type: Array,
default: []
+ },
+ curId: {
+ default: ''
}
},
data () {
diff --git a/src/setting.js b/src/setting.js
index 3427890..dfab01a 100644
--- a/src/setting.js
+++ b/src/setting.js
@@ -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/'
}
diff --git a/src/utils/api.js b/src/utils/api.js
index 6b7e8bb..231096a 100644
--- a/src/utils/api.js
+++ b/src/utils/api.js
@@ -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文件
diff --git a/src/views/course/AddCurriculum.vue b/src/views/course/AddCurriculum.vue
index 49e12ec..3ca5146 100644
--- a/src/views/course/AddCurriculum.vue
+++ b/src/views/course/AddCurriculum.vue
@@ -296,7 +296,7 @@
- systemChange(val, { systemId: projects[0].systemId })">
+ checkAllChange(val, projects[0].systemId)">
-
projectChange(val, item)">
@@ -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(() => {})
},
// 确认系统
diff --git a/src/views/course/contentSettings.vue b/src/views/course/contentSettings.vue
index f3ea323..9b463e4 100644
--- a/src/views/course/contentSettings.vue
+++ b/src/views/course/contentSettings.vue
@@ -97,7 +97,6 @@
:action="this.api.fileupload"
:file-list="uploadList"
:headers="headers"
- :http-request="handleRequest"
name="file"
>
上传资源
diff --git a/src/views/information/addArticle/index.vue b/src/views/information/addArticle/index.vue
index 42bc855..c460f4d 100644
--- a/src/views/information/addArticle/index.vue
+++ b/src/views/information/addArticle/index.vue
@@ -6,8 +6,8 @@
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
-
+
+
确定
@@ -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() {
diff --git a/src/views/information/columnManage/index.vue b/src/views/information/columnManage/index.vue
index c191b6b..774d4a1 100644
--- a/src/views/information/columnManage/index.vue
+++ b/src/views/information/columnManage/index.vue
@@ -21,8 +21,7 @@
操作
-
+
{{ data.name }}
@@ -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;
}
}
};
diff --git a/src/views/information/contentManage/contentList.vue b/src/views/information/contentManage/contentList.vue
index 98f9f03..d66c580 100644
--- a/src/views/information/contentManage/contentList.vue
+++ b/src/views/information/contentManage/contentList.vue
@@ -16,7 +16,7 @@
{{ scope.$index + (pageNo - 1) * pageSize + 1 }}
-
+
diff --git a/src/views/information/contentManage/index.vue b/src/views/information/contentManage/index.vue
index a14f9f4..f47c7b3 100644
--- a/src/views/information/contentManage/index.vue
+++ b/src/views/information/contentManage/index.vue
@@ -1,25 +1,23 @@
-
-