mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-09 02:46:44 +08:00
课程管理列表适应管理端的调整
This commit is contained in:
@@ -68,10 +68,10 @@ const revokeSubmit = function(id) {
|
||||
|
||||
/**
|
||||
* 复制课程
|
||||
* @param {Object} id
|
||||
* @param {Object}
|
||||
*/
|
||||
const copyCourse = function(id) {
|
||||
return ajax.post('/xboe/m/course/manage/copy', {id});
|
||||
const copyCourse = function(data) {
|
||||
return ajax.post('/xboe/m/course/manage/copy',data);
|
||||
}
|
||||
/*
|
||||
查询课程是否有重复名称
|
||||
|
||||
@@ -108,6 +108,9 @@
|
||||
<el-form-item label="目标人群" required>
|
||||
<el-input maxlength="50" v-model="courseInfo.forUsers" show-word-limit placeholder="目标人群(限50字以内)"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="visibleShow" label="学员可见">
|
||||
<el-checkbox v-model="courseInfo.visible"></el-checkbox>
|
||||
</el-form-item>
|
||||
<el-form-item label="受众" v-if="!weike.onlyRequired">
|
||||
<el-select value-key="id" style="width: 100%;" v-model="courseCrowds" filterable multiple :clearable="false" @remove-tag="removeCrowd" placeholder="请选择">
|
||||
<el-option v-for="item in userGroupList" :key="item.id" :disabled="item.disabled" :label="item.name" :value="item"></el-option>
|
||||
@@ -256,7 +259,14 @@
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="目标人群" required>
|
||||
<el-input maxlength="50" v-model="courseInfo.forUsers" show-word-limit placeholder="目标人群(限50字以内)"></el-input>
|
||||
<el-col :span="14">
|
||||
<el-input maxlength="50" v-model="courseInfo.forUsers" show-word-limit placeholder="目标人群(限50字以内)"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-form-item v-if="visibleShow" label="学员可见">
|
||||
<el-checkbox v-model="courseInfo.visible"></el-checkbox>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="受众"><!--:disabled="item.disabled"-->
|
||||
<el-select value-key="id" style="width: 100%;" v-model="courseCrowds" filterable multiple :clearable="false" @remove-tag="removeCrowd" placeholder="请选择">
|
||||
@@ -463,7 +473,13 @@ export default {
|
||||
status: 1,
|
||||
summary: '',
|
||||
overview: '',
|
||||
visible:true,
|
||||
refId:'',
|
||||
refType:''
|
||||
},
|
||||
visibleShow:false,
|
||||
extendRefId:'',
|
||||
extendRefType:'',
|
||||
courseTeachers: [], //课程的老师
|
||||
courseCrowds:[],//课程的用户受众
|
||||
curContent: { id: '', contentType: 0, csectionId: '', contentName: '', contentRefId: '' }, //当前编辑的内容
|
||||
@@ -534,6 +550,12 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
let extendFlag=this.$route.query.f; //是否是管理端过来的
|
||||
this.extendRefId=this.$route.query.refId;
|
||||
this.extendRefType=this.$route.query.refId;
|
||||
if(extendFlag && extendFlag=='choose'){
|
||||
this.visibleShow=true;
|
||||
}
|
||||
this.curStepIndex = 1; //回到第一步
|
||||
this.btnLoading = false;
|
||||
this.getResOwnerTree().then(rs => {
|
||||
@@ -705,8 +727,13 @@ export default {
|
||||
status: 1,
|
||||
summary: '',
|
||||
overview: '',
|
||||
// checked:false,
|
||||
visible:true,
|
||||
refId:this.extendRefId,
|
||||
refType:this.extendRefType
|
||||
};
|
||||
if(this.extendRefId){
|
||||
this.courseInfo.visible=false;
|
||||
}
|
||||
this.contentInfo.list = [];
|
||||
this.sectionInfo.list = [];
|
||||
this.courseTeachers = [];
|
||||
@@ -842,6 +869,9 @@ export default {
|
||||
const { result, status } = await apiCourse.detail(id);
|
||||
if (status === 200) {
|
||||
//把数据附给三个对象
|
||||
if(result.course.visible==''){
|
||||
result.course.visible=true;
|
||||
}
|
||||
this.courseInfo = result.course;
|
||||
this.checked = false;
|
||||
this.contentInfo.list = result.contents;
|
||||
|
||||
@@ -374,14 +374,19 @@ export default {
|
||||
catalogs: {
|
||||
addNewZhang: false,
|
||||
addNewCell: false,
|
||||
}
|
||||
},
|
||||
extendRefId:'',
|
||||
extendRefType:'',
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
let chooseFlag=this.$route.query.f;
|
||||
this.extendRefId=this.$route.query.refId;
|
||||
this.extendRefType=this.$route.query.refId;
|
||||
if(chooseFlag && chooseFlag=='choose'){
|
||||
this.forChoose=true;
|
||||
}
|
||||
|
||||
if(this.$route.query && this.$route.query.page && this.$route.query.page == 'manage') {
|
||||
this.pageManage=true;
|
||||
}
|
||||
@@ -484,12 +489,18 @@ export default {
|
||||
},
|
||||
// 复制
|
||||
copyCourse(item) {
|
||||
let $this=this;
|
||||
this.$confirm('您确定要复制此课程吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
apiCourse.copyCourse(item.id).then(rs=>{
|
||||
let reqdata={
|
||||
id:item.id,
|
||||
refId:$this.extendRefId,
|
||||
refType:$this.extendRefType,
|
||||
}
|
||||
apiCourse.copyCourse(reqdata).then(rs=>{
|
||||
if(rs.status==200){
|
||||
this.$message.success("复制课程成功");
|
||||
this.searchData();
|
||||
@@ -614,6 +625,12 @@ export default {
|
||||
if(pageReset){
|
||||
this.page.pageIndex=1;
|
||||
}
|
||||
if(this.extendRefId){
|
||||
this.params.refId=this.extendRefId;
|
||||
}
|
||||
if(this.extendRefType){
|
||||
this.params.refType=this.extendRefType;
|
||||
}
|
||||
this.params.resOwner1 = this.resOwner[0];
|
||||
this.params.resOwner2 = this.resOwner[1];
|
||||
this.params.resOwner3 = this.resOwner[2];
|
||||
|
||||
Reference in New Issue
Block a user