课程管理等

Branch_d40a2540
yujialong 2 years ago
parent 100e8ce165
commit 9ba8896318
  1. 37
      src/api/index.js
  2. 21
      src/pages/course/add/index.vue
  3. 4
      src/pages/course/list/courseManagement/index.vue
  4. 107
      src/pages/course/list/sortManagement/index.vue
  5. 3
      src/setting.js

@ -2,6 +2,7 @@ import Setting from "@/setting";
const host = Setting.apiBaseURL const host = Setting.apiBaseURL
const uploadURL = Setting.upload.apiURL; const uploadURL = Setting.upload.apiURL;
const host1 = "http://121.37.12.51:8080/" const host1 = "http://121.37.12.51:8080/"
const host2 = 'http://192.168.31.137:9000/'
export default { export default {
queryToken: `liuwanr/userInfo/queryToken`, queryToken: `liuwanr/userInfo/queryToken`,
@ -141,20 +142,20 @@ export default {
saveAnnouncementAnnex: `occupationlab/occupationlab/contestAnnouncementAnnex/save`, saveAnnouncementAnnex: `occupationlab/occupationlab/contestAnnouncementAnnex/save`,
// 栏目管理 // 栏目管理
addColumn: `occupationlab/occupationlab/enterprise/information/column/addColumn`, addColumn: `${host2}occupationlab/occupationlab/information/column/addColumn`,
deleteColumn: `occupationlab/occupationlab/enterprise/information/column/deleteColumn`, deleteColumn: `${host2}occupationlab/occupationlab/information/column/deleteColumn`,
editColumn: `occupationlab/occupationlab/enterprise/information/column/editColumn`, editColumn: `${host2}occupationlab/occupationlab/information/column/editColumn`,
queryAllColumns: `occupationlab/occupationlab/enterprise/information/column/queryAllColumns`, queryAllColumns: `${host2}occupationlab/occupationlab/information/column/queryAllColumns`,
columnReorder: `occupationlab/occupationlab/enterprise/information/column/reorder`, columnReorder: `${host2}occupationlab/occupationlab/information/column/reorder`,
// 内容管理 // 内容管理
addArticle: `occupationlab/occupationlab/enterprise/information/article/addArticle`, addArticle: `${host2}occupationlab/occupationlab/information/article/addArticle`,
deleteArticles: `occupationlab/occupationlab/enterprise/information/article/deleteArticles`, deleteArticles: `${host2}occupationlab/occupationlab/information/article/deleteArticles`,
editArticle: `occupationlab/occupationlab/enterprise/information/article/editArticle`, editArticle: `${host2}occupationlab/occupationlab/information/article/editArticle`,
enableArticle: `occupationlab/occupationlab/enterprise/information/article/enableArticle`, enableArticle: `${host2}occupationlab/occupationlab/information/article/enableArticle`,
getArticle: `occupationlab/occupationlab/enterprise/information/article/getArticle`, getArticle: `${host2}occupationlab/occupationlab/information/article/getArticle`,
getArticles: `occupationlab/occupationlab/enterprise/information/article/getArticles`, getArticles: `${host2}occupationlab/occupationlab/information/article/getArticles`,
queryArticleByCondition: `occupationlab/occupationlab/enterprise/information/article/queryArticleByCondition`, queryArticleByCondition: `${host2}occupationlab/occupationlab/information/article/queryArticleByCondition`,
articleSort: `occupationlab/occupationlab/enterprise/information/article/articleSort`, articleSort: `${host2}occupationlab/occupationlab/information/article/articleSort`,
// 课程管理 // 课程管理
queryCourseByCondition: `occupationlab/occupationlab/management/edu/course/queryCourseByCondition`, // 课程列表分页条件查询 queryCourseByCondition: `occupationlab/occupationlab/management/edu/course/queryCourseByCondition`, // 课程列表分页条件查询
@ -165,10 +166,12 @@ export default {
enableCourse: `occupationlab/occupationlab/management/schoolCourse/enableGlCourse`, // 是否启用管理端课程 enableCourse: `occupationlab/occupationlab/management/schoolCourse/enableGlCourse`, // 是否启用管理端课程
getCourse: `occupationlab/occupationlab/management/edu/course/getCourse`, // 根据id查询课程 getCourse: `occupationlab/occupationlab/management/edu/course/getCourse`, // 根据id查询课程
// 分类管理 // 分类管理
queryGlClassification: `occupationlab/occupationlab/management/edu/courseClassification/queryGlClassification`, checkRepeat: `occupationlab/theoreticalCourseClassification/checkRepeat`,
deleteClassification: `occupationlab/occupationlab/management/edu/courseClassification/deleteClassification`, delClassification: `occupationlab/theoreticalCourseClassification/delete`,
addClassification: `occupationlab/occupationlab/management/edu/courseClassification/addClassification`, findClassification: `occupationlab/theoreticalCourseClassification/findById`,
editClassification: `occupationlab/occupationlab/management/edu/courseClassification/editClassification`, listClassification: `occupationlab/theoreticalCourseClassification/pagingQuery`,
saveClassification: `occupationlab/theoreticalCourseClassification/save`,
updateClassification: `occupationlab/theoreticalCourseClassification/update`,
// 课程章节管理 // 课程章节管理
addChapter: `occupationlab/occupationlab/management/edu/courseChapter/addChapter`, addChapter: `occupationlab/occupationlab/management/edu/courseChapter/addChapter`,
chapterReorder: `occupationlab/occupationlab/management/edu/courseChapter/chapterReorder`, chapterReorder: `occupationlab/occupationlab/management/edu/courseChapter/chapterReorder`,

@ -7,12 +7,24 @@
</el-card> </el-card>
<el-card shadow="hover" class="m-b-20"> <el-card shadow="hover" class="m-b-20">
<el-form :disabled="isDetail" label-width="80px" label-suffix=":"> <el-form :disabled="isDetail" label-width="100px" label-suffix=":">
<el-form-item label="课程名称"> <el-form-item label="课程名称">
<div class="d-inline-block"> <div class="d-inline-block">
<el-input placeholder="请输入课程名称" v-model="form.name" clearable maxlength="25"></el-input> <el-input placeholder="请输入课程名称" v-model="form.name" clearable maxlength="25"></el-input>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="课程类型">
<div class="d-inline-block">
<el-select v-model="form.classificationId" placeholder="请选择课程类型">
<el-option label="免费" value="1"></el-option>
</el-select>
</div>
</el-form-item>
<el-form-item label="可见范围">
<div class="d-inline-block">
<el-radio v-model="form.classificationId">本校</el-radio>
</div>
</el-form-item>
<el-form-item label="课程分类"> <el-form-item label="课程分类">
<div class="d-inline-block"> <div class="d-inline-block">
<el-select v-model="form.classificationId" placeholder="请选择课程分类"> <el-select v-model="form.classificationId" placeholder="请选择课程分类">
@ -20,6 +32,13 @@
</el-select> </el-select>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="平台课程分类">
<div class="d-inline-block">
<el-select v-model="form.classificationId" placeholder="平台请选择课程分类">
<el-option v-for="item in classificationList" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</div>
</el-form-item>
<el-form-item label="课程封面"> <el-form-item label="课程封面">
<el-upload <el-upload
class="avatar-uploader" class="avatar-uploader"

@ -30,6 +30,8 @@
</el-table-column> </el-table-column>
<el-table-column prop="name" label="课程名称"> <el-table-column prop="name" label="课程名称">
</el-table-column> </el-table-column>
<el-table-column prop="classification" label="课程分类">
</el-table-column>
<el-table-column prop="gmtCreate" label="创建时间" align="center"> <el-table-column prop="gmtCreate" label="创建时间" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="founder" label="创建人" align="center"> <el-table-column prop="founder" label="创建人" align="center">
@ -39,8 +41,6 @@
{{ scope.row.chapterNum ? scope.row.chapterNum : 0 }}({{ scope.row.subsectionNum ? scope.row.subsectionNum : 0 }}小节) {{ scope.row.chapterNum ? scope.row.chapterNum : 0 }}({{ scope.row.subsectionNum ? scope.row.subsectionNum : 0 }}小节)
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="classification" label="课程分类">
</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">
<el-button v-auth="'课程管理:编辑信息'" type="text" @click="editCourse(scope.row)">编辑信息</el-button> <el-button v-auth="'课程管理:编辑信息'" type="text" @click="editCourse(scope.row)">编辑信息</el-button>

@ -9,13 +9,13 @@
<el-button v-auth="'分类管理:新增'" type="primary" round @click="addClass">新增</el-button> <el-button v-auth="'分类管理:新增'" type="primary" round @click="addClass">新增</el-button>
</div> </div>
</div> </div>
<el-table :data="classificationList" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id"> <el-table :data="list" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
<el-table-column type="index" width="100" label="序号" align="center"> <el-table-column type="index" width="100" label="序号" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.$index + (pageNo - 1) * pageSize + 1 }} {{ scope.$index + (page - 1) * pageSize + 1 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="name" label="课程分类名称"> <el-table-column prop="classificationName" label="课程分类名称">
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="300"> <el-table-column label="操作" align="center" width="300">
<template slot-scope="scope"> <template slot-scope="scope">
@ -25,11 +25,15 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="page">
</el-pagination>
</div>
<el-dialog :title="isAddclass ? '添加分类' : '编辑分类'" :visible.sync="classVisible" width="400px" :close-on-click-modal="false" @close="closeColumn"> <el-dialog :title="!curRow.id ? '添加分类' : '编辑分类'" :visible.sync="classVisible" width="400px" :close-on-click-modal="false" @close="closeColumn">
<el-form> <el-form>
<el-form-item> <el-form-item>
<el-input placeholder="分类名称" v-model="className"></el-input> <el-input placeholder="分类名称" v-model="classificationName"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
@ -42,43 +46,51 @@
<script> <script>
import util from "@/libs/util"; import util from "@/libs/util";
import Setting from '@/setting'
export default { export default {
name: "sortManagement", name: "sortManagement",
data() { data() {
return { return {
classificationList: [], list: [],
multipleSelection: [], multipleSelection: [],
pageNo: 1, page: 1,
pageSize: 10, pageSize: 10,
isAddclass: true, total: 0,
classVisible: false, classVisible: false,
curRow: {}, curRow: {},
className: "" classificationName: "",
nameRepeat: false
}; };
}, },
watch: {
classificationName: function(val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.nameChange();
}, 500);
}
},
mounted() { mounted() {
this.getData(); this.getData();
}, },
methods: { methods: {
getData() { getData() {
this.$get(this.api.queryGlClassification).then(res => { this.$post(this.api.listClassification, {
this.classificationList = res.classificationList; pageNum: this.page,
pageSize: this.pageSize,
platformSource: Setting.platformSource
}).then(({ page }) => {
this.list = page.records
this.total = page.total
}).catch(res => { }).catch(res => {
}); });
}, },
addCourse() {
this.$router.push("/addcourse");
},
editCourse(row) {
this.$router.push(`/addcourse?id=${row.id}`);
},
handleDelete(row) { handleDelete(row) {
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", { this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
type: "warning" type: "warning"
}) })
.then(() => { .then(() => {
this.$del(`${this.api.deleteClassification}/${row.id}`).then(res => { this.$post(`${this.api.delClassification}?id=${row.id}`).then(res => {
util.successMsg("删除成功"); util.successMsg("删除成功");
this.getData(); this.getData();
}).catch(res => { }).catch(res => {
@ -87,69 +99,54 @@ export default {
.catch(() => { .catch(() => {
}); });
}, },
getRowKeys(row) {
return row.customerId;
},
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val;
}, },
closeColumn() { closeColumn() {
this.className = ""; this.classificationName = "";
this.curRow = {}; this.curRow = {};
}, },
delAllData() {
if (this.multipleSelection.length != "") {
let newArr = this.multipleSelection;
let delList = newArr.map(item => {
return item.id;
});
//
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
type: "warning"
})
.then(() => {
let data = delList.join();
this.$del(this.api.deleteClassification, data).then(res => {
this.multipleSelection = [];
util.successMsg("删除成功");
this.getData();
}).catch(res => {
});
}).catch(() => {
});
} else {
util.errorMsg("请先选择数据 !");
}
},
handleCurrentChange(val) { handleCurrentChange(val) {
this.pageNo = val; this.page = val;
this.getData(); this.getData();
}, },
addClass() { addClass() {
this.isAddClass = true;
this.classVisible = true; this.classVisible = true;
}, },
editClass(row) { editClass(row) {
this.curRow = row; this.curRow = row;
this.className = row.name; this.classificationName = row.classificationName;
this.isAddClass = false;
this.classVisible = true; this.classVisible = true;
}, },
nameChange(val) {
const row = this.curRow
this.$post(this.api.checkRepeat, {
id: row.id,
platformSource: Setting.platformSource,
classificationName: this.classificationName
}).then(res => {
this.nameRepeat = false
}).catch(res => {
this.nameRepeat = true
})
},
classSubmit() { classSubmit() {
if (!this.className) return util.warningMsg("请填写分类名称"); if (!this.classificationName) return util.errorMsg("请填写分类名称");
if (this.nameRepeat) return util.errorMsg("当前分类已存在!");
let data = { let data = {
name: this.className classificationName: this.classificationName,
platformSource: Setting.platformSource
}; };
if (this.curRow.id) { if (this.curRow.id) {
data.id = this.curRow.id; data.id = this.curRow.id;
this.$put(this.api.editClassification, data).then(res => { this.$post(this.api.updateClassification, data).then(res => {
util.successMsg("修改成功"); util.successMsg("修改成功");
this.classVisible = false; this.classVisible = false;
this.getData(); this.getData();
}).catch(res => { }).catch(res => {
}); });
} else { } else {
this.$post(`${this.api.addClassification}/${this.className}?distinguish=1`).then(res => { this.$post(this.api.saveClassification, data).then(res => {
util.successMsg("添加成功"); util.successMsg("添加成功");
this.classVisible = false; this.classVisible = false;
this.getData(); this.getData();

@ -23,7 +23,7 @@ if (isPro) {
jumpPath = "http://192.168.31.125:8087/"; jumpPath = "http://192.168.31.125:8087/";
bankPath = `http://192.168.31.125:8093` bankPath = `http://192.168.31.125:8093`
host = "http://121.37.12.51/"; // 中台测试服 host = "http://121.37.12.51/"; // 中台测试服
// 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/'; // 赓
} }
@ -33,6 +33,7 @@ const Setting = {
* */ * */
platformId: 1, // 平台标识,1职站,2数据平台,3中台 platformId: 1, // 平台标识,1职站,2数据平台,3中台
platformType: 0, // 平台端区分:0->教师端 1->学生端 2->无端 platformType: 0, // 平台端区分:0->教师端 1->学生端 2->无端
platformSource: 1, // 平台来源(0中台,1职站)
titleSuffix: title, // 网页标题的后缀 titleSuffix: title, // 网页标题的后缀
routerMode: "hash", // 路由模式,可选值为 history 或 hash routerMode: "hash", // 路由模式,可选值为 history 或 hash
showProgressBar: true, // 页面切换时,是否显示模拟的进度条 showProgressBar: true, // 页面切换时,是否显示模拟的进度条

Loading…
Cancel
Save