mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-10 19:36:43 +08:00
我报名的 切换成新的接口,包括 删除,跳转
This commit is contained in:
@@ -54,16 +54,21 @@ const courseList = function(data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除课程
|
* 删除学习的课程,已经不再使用,换成新的
|
||||||
* @param {Object} ms_timeline_kid
|
* @param {Object} ms_timeline_kid
|
||||||
*/
|
*/
|
||||||
const delLearning = function(ms_timeline_kid) {
|
const delLearning = function(ms_timeline_kid) {
|
||||||
return ajax.post('/b1/system/user/ms-timeline-delete',{ms_timeline_kid});
|
return ajax.post('/b1/system/user/ms-timeline-delete',{ms_timeline_kid});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**新的删除学习的课程的接口,参数courseRegId, 对应的课程的id */
|
||||||
|
const newDelLearning = function(courseRegId) {
|
||||||
|
return ajax.post('/b1/system/user/delete-course-reg',{courseRegId});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户的kid,获取用户的受众权限
|
* 根据用户的kid,获取用户的受众权限
|
||||||
*
|
*
|
||||||
* @param {Object} kid
|
* @param {Object} kid
|
||||||
*/
|
*/
|
||||||
const audience = function(kid) {
|
const audience = function(kid) {
|
||||||
@@ -76,5 +81,6 @@ export default {
|
|||||||
reportList,
|
reportList,
|
||||||
courseList,
|
courseList,
|
||||||
delLearning,
|
delLearning,
|
||||||
|
newDelLearning,
|
||||||
audience
|
audience
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,13 @@ const userTaskList = function(data){
|
|||||||
return ajax.postJson(baseURL,'/todoTask/queryTodoTaskDetail',data);
|
return ajax.postJson(baseURL,'/todoTask/queryTodoTaskDetail',data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**删除学习,取消报名*/
|
||||||
|
const userDeleteStudy = function(data){
|
||||||
|
return ajax.postJson(baseURL,'/stu/project/stuCancelEnrollment',data);
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
getTaskNum,
|
getTaskNum,
|
||||||
userTaskList
|
userTaskList,
|
||||||
|
userDeleteStudy
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -370,6 +370,12 @@ const ids=function (data){
|
|||||||
const followIds=function (data){
|
const followIds=function (data){
|
||||||
return ajax.postJson('/xboe/school/study/course/follow-ids',data);
|
return ajax.postJson('/xboe/school/study/course/follow-ids',data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**从ES中查询我学习的课程数据*/
|
||||||
|
const myStudysFromES=function (data){
|
||||||
|
return ajax.post('/xboe/school/study/es/search',data);
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
hasSignup,
|
hasSignup,
|
||||||
signup,
|
signup,
|
||||||
@@ -399,6 +405,7 @@ export default {
|
|||||||
myAssessList,
|
myAssessList,
|
||||||
myExamList2,
|
myExamList2,
|
||||||
myCourseStudy,
|
myCourseStudy,
|
||||||
|
myStudysFromES,
|
||||||
deleteSignUp,
|
deleteSignUp,
|
||||||
ids,
|
ids,
|
||||||
followIds
|
followIds
|
||||||
|
|||||||
@@ -23,12 +23,12 @@
|
|||||||
<!-- <el-option label="已停用" :value="3"></el-option> -->
|
<!-- <el-option label="已停用" :value="3"></el-option> -->
|
||||||
</el-select>
|
</el-select>
|
||||||
<div style="padding-left: 12px;"><el-input class="uc-input" v-model="params.courseName" clearable placeholder="搜索名称"></el-input></div>
|
<div style="padding-left: 12px;"><el-input class="uc-input" v-model="params.courseName" clearable placeholder="搜索名称"></el-input></div>
|
||||||
<div style="padding-left: 12px;"><el-button type="primary" class="search-btn" icon="el-icon-search" @click="searchData()">搜索</el-button></div>
|
<div style="padding-left: 12px;"><el-button type="primary" class="search-btn" icon="el-icon-search" @click="findStudys(true)">搜索</el-button></div>
|
||||||
<div style="padding-left: 12px"><el-button type="primary" class="search-btn" icon="el-icon-refresh-right" @click="reset()">重置</el-button></div>
|
<div style="padding-left: 12px"><el-button type="primary" class="search-btn" icon="el-icon-refresh-right" @click="reset()">重置</el-button></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="uc-list" v-loading="loading">
|
<div class="uc-list" v-loading="loading">
|
||||||
<div class="uc-course" v-for="(item,idx) in pageChange" :key="idx">
|
<div class="uc-course" v-for="(item,idx) in couresList" :key="idx">
|
||||||
<div class="uc-course-img" style="width: 260px;height:144px" @click="jumpRouter(item)">
|
<div class="uc-course-img" style="width: 260px;height:144px" @click="jumpRouter(item)">
|
||||||
<course-image :course="item"></course-image>
|
<course-image :course="item"></course-image>
|
||||||
<div class="uc-type">
|
<div class="uc-type">
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="uc-course-info" @click="jumpRouter(item)">
|
<div class="uc-course-info" @click="jumpRouter(item)">
|
||||||
<div class="uc-course-name" style="cursor: pointer;">
|
<div class="uc-course-name" style="cursor: pointer;">
|
||||||
|
|
||||||
<div style="flex:1;">
|
<div style="flex:1;">
|
||||||
<a v-html="$keywordActiveShow(item.courseName,params.courseName)" class="uc-title two-line-ellipsis"></a>
|
<a v-html="$keywordActiveShow(item.courseName,params.courseName)" class="uc-title two-line-ellipsis"></a>
|
||||||
</div>
|
</div>
|
||||||
@@ -74,7 +74,7 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="pageChange.length > 0 " style="text-align: center;margin-top:57px;">
|
<div v-if="couresList.length > 0 " style="text-align: center;margin-top:57px;">
|
||||||
<el-pagination background
|
<el-pagination background
|
||||||
@size-change="handleSizeChange"
|
@size-change="handleSizeChange"
|
||||||
@current-change="handleCurrentChange"
|
@current-change="handleCurrentChange"
|
||||||
@@ -82,20 +82,21 @@
|
|||||||
:page-sizes="[10, 20, 30, 40]"
|
:page-sizes="[10, 20, 30, 40]"
|
||||||
:page-size="page.pageSize"
|
:page-size="page.pageSize"
|
||||||
layout="total, sizes, prev, pager, next, jumper"
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
:total="couresList.length">
|
:total="page.count">
|
||||||
</el-pagination>
|
</el-pagination>
|
||||||
</div>
|
</div>
|
||||||
<div class="list-wu">
|
<div class="list-wu">
|
||||||
<div v-if="loading">
|
<div v-if="loading"> <span>加载中...</span> </div>
|
||||||
<span v-if="dataList.length==0">正在加载数据...</span>
|
|
||||||
<span v-else>查询中...</span>
|
|
||||||
</div>
|
|
||||||
<div v-else class="home-no-list">
|
<div v-else class="home-no-list">
|
||||||
<!-- <span v-if="dataList.length==0">当前列表无数据</span>
|
<div v-if="page.count==0 && !loading">
|
||||||
<span v-else-if="couresList.length==0" >未找到您要搜索的内容</span> -->
|
<div v-if="isSearch">
|
||||||
<img v-if="dataList.length==0 || couresList.length==0" class="img" style="width:360px;height:226px" :src="`${webBaseUrl}/images/homeWu/no-madel.png`" alt="" srcset="">
|
<p class="text" style="color: #333333;margin-top:50px;font-size: 14px">未找到您要搜索的内容</p>
|
||||||
<p v-if="dataList.length==0" class="text" style="color: #333333;margin-top:50px;font-size: 14px">您还没有报名课程哦~</p>
|
</div>
|
||||||
<p v-else-if="couresList.length==0" class="text" style="color: #333333;margin-top:50px;font-size: 14px">未找到您要搜索的内容</p>
|
<div v-else >
|
||||||
|
<img class="img" style="width:360px;height:226px" :src="`${webBaseUrl}/images/homeWu/no-madel.png`" alt="" srcset="">
|
||||||
|
<p class="text" style="color: #333333;margin-top:50px;font-size: 14px">您还没有报名课程哦~</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -104,8 +105,9 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import studyItem from '@/components/Course/studyItem.vue';
|
import studyItem from '@/components/Course/studyItem.vue';
|
||||||
import apicourseStudy from '@/api/modules/courseStudy.js';
|
import apiCourseStudy from '@/api/modules/courseStudy.js';
|
||||||
import apiBoeCourse from '@/api/boe/course.js';
|
import apiBoeCourse from '@/api/boe/course.js';
|
||||||
|
import apiManage from '@/api/manage/manage.js';
|
||||||
import studyImage from '@/components/Course/studyImage.vue';
|
import studyImage from '@/components/Course/studyImage.vue';
|
||||||
import courseImage from "@/components/Course/courseImage.vue";
|
import courseImage from "@/components/Course/courseImage.vue";
|
||||||
export default {
|
export default {
|
||||||
@@ -115,6 +117,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
courseType: '',
|
courseType: '',
|
||||||
status: '',
|
status: '',
|
||||||
|
isSearch:false,
|
||||||
loading: true,
|
loading: true,
|
||||||
fileUrl:process.env.VUE_APP_FILE_BASE_URL,
|
fileUrl:process.env.VUE_APP_FILE_BASE_URL,
|
||||||
page: {
|
page: {
|
||||||
@@ -124,231 +127,101 @@ export default {
|
|||||||
},
|
},
|
||||||
dataList: [],//总数据
|
dataList: [],//总数据
|
||||||
isNextPage: false,
|
isNextPage: false,
|
||||||
pageIndex:1,
|
|
||||||
isListOne: true,
|
isListOne: true,
|
||||||
params: { courseName: '', courseType: '',status:''},
|
params: { courseName: '', courseType: '',status:''},
|
||||||
couresList: [],//显示的数据
|
couresList: [],//显示的数据
|
||||||
options: [
|
|
||||||
{
|
|
||||||
value: 1,
|
|
||||||
label: '项目'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 2,
|
|
||||||
label: '课程',
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
value: 10,
|
|
||||||
label: '微课'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 21,
|
|
||||||
label: '录播课'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
|
||||||
pageChange() {
|
|
||||||
let list = this.couresList.slice((this.page.pageIndex -1)* this.page.pageSize,this.page.pageIndex*this.page.pageSize);
|
|
||||||
return list;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
mounted() {
|
mounted() {
|
||||||
// this.searchData();
|
this.findStudys(true);
|
||||||
// this.getMyLearning()
|
|
||||||
this.getData();
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
delItem(item,itemIdx){
|
delItem(item,itemIdx){
|
||||||
this.$confirm('您确定要删除所选课程吗?', '删除提示', {
|
this.$confirm('您确定要删除所选课程吗?', '删除提示', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() =>{
|
}).then(() =>{
|
||||||
if(item.isOld){
|
if(item.source==1){ //老系统删除
|
||||||
apiBoeCourse.delLearning(item.kid).then(res=>{
|
//this.$message({ type: 'error', message: '此类型的报名删除还无对接接口'});
|
||||||
|
apiBoeCourse.newDelLearning(item.courseId).then(res=>{
|
||||||
if(res.status==200){
|
if(res.status==200){
|
||||||
this.$message({ type: 'success',center: true, message: '课程删除成功!' });
|
this.$message({ type: 'success',center: true, message: '课程删除成功!' });
|
||||||
this.couresList.forEach((ic,index)=>{
|
this.couresList.splice(itemIdx,1);
|
||||||
if(item.kid == ic.kid) {
|
|
||||||
this.couresList.splice(index,1);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
this.dataList.forEach((it,i)=>{
|
|
||||||
if(item.id == it.id) {
|
|
||||||
this.dataList.splice(i,1);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
this.$message({ type: 'error', message: res.message });
|
this.$message({ type: 'error', message: res.message });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}else{
|
}else if(item.source==2){ //本地删除
|
||||||
apicourseStudy.deleteSignUp(item.id,item.courseId).then(res =>{
|
apiCourseStudy.deleteSignUp(item.id,item.courseId).then(res =>{
|
||||||
if(res.status==200){
|
if(res.status==200){
|
||||||
this.$message({ type: 'success', message: '删除成功!' });
|
this.$message({ type: 'success', message: '删除成功!' });
|
||||||
this.couresList.forEach((ic,index)=>{
|
this.couresList.splice(itemIdx,1);
|
||||||
if(item.id == ic.id) {
|
|
||||||
this.couresList.splice(index,1);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
this.dataList.forEach((it,i)=>{
|
|
||||||
if(item.id == it.id) {
|
|
||||||
this.dataList.splice(i,1);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
this.$message({ type: 'error', message: res.message });
|
this.$message({ type: 'error', message: res.message });
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}else if(item.source==3){ //管理端删除
|
||||||
|
var reqData={ pid:item.courseId, student:item.accountId }
|
||||||
|
apiManage.userDeleteStudy(reqData).then(res=>{
|
||||||
|
if(res.code==200){
|
||||||
|
this.$message({ type: 'success', message: '删除成功!' });
|
||||||
|
this.couresList.splice(itemIdx,1);
|
||||||
|
}else{
|
||||||
|
this.$message({ type: 'success', message: '删除失败!' });
|
||||||
|
this.couresList.splice(itemIdx,1);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
this.$message({ type: 'error', message: '此报名未关联源,请与管理员联系'});
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
async getData() { //当前方案,此处只是加载一次
|
findStudys(flag){ //新的
|
||||||
let type = '';
|
if(flag){
|
||||||
// if(this.params.courseType){
|
this.page.pageIndex=1;
|
||||||
if(this.params.courseType==20){
|
|
||||||
type='online-course';
|
|
||||||
}else if(this.params.courseType==30){
|
|
||||||
type='face-course';
|
|
||||||
}else if(this.params.courseType==40){
|
|
||||||
type='project';
|
|
||||||
}
|
}
|
||||||
// }
|
this.isSearch=false;
|
||||||
// if(this.params.courseType ==20 ){
|
let reqData={
|
||||||
// this.params.courseType = [10,20]
|
courseName:this.params.courseName,
|
||||||
// }
|
courseType:this.courseType,
|
||||||
this.loading = true;
|
status:this.status,
|
||||||
let data = {
|
progress:'',
|
||||||
type:type,
|
pageIndex:this.page.pageIndex,
|
||||||
page:this.pageIndex,
|
pageSize:this.page.pageSize
|
||||||
size:100
|
|
||||||
}
|
}
|
||||||
this.isListOne = true;
|
if(reqData.courseName || reqData.courseType || reqData.status){
|
||||||
this.params.pageSize = 100;
|
this.isSearch=true;
|
||||||
this.params.pageIndex = 1;
|
}
|
||||||
let list = this.dataList;
|
this.loading=true;
|
||||||
let clist = this.couresList;
|
apiCourseStudy.myStudysFromES(reqData).then(res=>{
|
||||||
// Promise.all([apiBoeCourse.myLearning(data),apicourseStudy.myStudyList(this.params)]).then(res=>{
|
if(res.status==200){
|
||||||
// let list = [];
|
this.couresList=res.result.list;
|
||||||
// list.push(...res[1].result.list);
|
this.page.count=res.result.count;
|
||||||
// res[1].result.list.forEach(item=>{
|
}else{
|
||||||
// item.courseImage = this.fileUrl + item.courseImage;
|
this.$message({ type: 'error', message: res.message });
|
||||||
// })
|
|
||||||
// let data = this.filterConversion(res[0].result.dataList);
|
|
||||||
// list.push(...data);
|
|
||||||
// this.couresList = list;
|
|
||||||
// this.dataList = list;
|
|
||||||
// this.loading = false;
|
|
||||||
// }).catch(err=>{
|
|
||||||
// console.log(err,'err');
|
|
||||||
// })
|
|
||||||
await apicourseStudy.myStudyList(this.params).then(res =>{
|
|
||||||
if(res.status == 200) {
|
|
||||||
res.result.list.forEach(item=>{
|
|
||||||
if(item.courseImage){
|
|
||||||
item.courseImage = this.fileUrl + item.courseImage;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
list.push(...res.result.list);
|
|
||||||
clist.push(...res.result.list);
|
|
||||||
}else{
|
|
||||||
console.log('加载报名数据失败:'+res.message);
|
|
||||||
}
|
|
||||||
this.loading = false;
|
|
||||||
})
|
|
||||||
await apiBoeCourse.myLearning(data).then(rs=>{
|
|
||||||
if(rs.status == 200) {
|
|
||||||
let data = this.filterConversion(rs.result.dataList);
|
|
||||||
list.push(...data);
|
|
||||||
clist.push(...data);
|
|
||||||
}else{
|
|
||||||
console.log('加载原报名数据失败:'+rs.message);
|
|
||||||
}
|
|
||||||
this.loading = false;
|
|
||||||
})
|
|
||||||
},
|
|
||||||
filterConversion(data){
|
|
||||||
let list = [];
|
|
||||||
data.forEach((item,index)=>{
|
|
||||||
let type = null;
|
|
||||||
if(item.type=='online-course'){
|
|
||||||
type=20;
|
|
||||||
}else if(item.type=='face-course'){
|
|
||||||
type=30;
|
|
||||||
}else if(item.type=='project'){
|
|
||||||
type=40;
|
|
||||||
}
|
}
|
||||||
let status = null;
|
this.loading=false;
|
||||||
if(item.status == '0') {
|
|
||||||
status = 1;
|
|
||||||
} else if(item.status == '1') {
|
|
||||||
status = 2;
|
|
||||||
}else if(item.status == '2') {
|
|
||||||
status = 9;
|
|
||||||
}
|
|
||||||
let num = item.completeProgress.replace('%',"");
|
|
||||||
item.completeProgress = Number(num);
|
|
||||||
list.push({
|
|
||||||
courseImage: item.cover[0].url,
|
|
||||||
courseName: item.title,
|
|
||||||
courseType: type,
|
|
||||||
id: item.id,
|
|
||||||
addTime:item.enrollTime,
|
|
||||||
progress: item.completeProgress,
|
|
||||||
status: status,
|
|
||||||
isOld: true,
|
|
||||||
kid:item.ms_timeline_kid
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
return list;
|
},
|
||||||
|
|
||||||
},
|
|
||||||
jumpRouter(item) {
|
jumpRouter(item) {
|
||||||
if(item.isOld){
|
if(item.sourse==1){
|
||||||
location.href=`${this.webBaseUrl}/course/boeframe?id=${item.id}&type=${item.courseType}`
|
location.href=`${this.webBaseUrl}/course/boeframe?id=${item.id}&type=${item.courseType}`
|
||||||
|
}else if(item.sourse==2){
|
||||||
|
this.$router.push({path:'/course/studyindex',query:{id:item.courseId}})
|
||||||
|
}else if(item.sourse==3){
|
||||||
|
//管理端跳转,只有30,没有40了
|
||||||
|
//let params=encodeURIComponent('routerId='+courseId);
|
||||||
|
//this.$router.push('/forward?to=/fe-student/pathdetails¶ms='+params);
|
||||||
|
let manageApi=process.env.VUE_APP_MANAGER_API_PATH;
|
||||||
|
let uparams=encodeURIComponent('courseId='+item.courseId);
|
||||||
|
this.$router.push('/forward?to='+manageApi+'/stu/project/redirectDetail¶ms='+uparams);
|
||||||
} else {
|
} else {
|
||||||
// if(item.courseType==10){
|
console.log('未识别的来源 '+item.sourse);
|
||||||
// this.$router.push({path:'/course/micro',query:{id:item.courseId}})
|
|
||||||
// }
|
|
||||||
// if(item.courseType==20){
|
|
||||||
// if(item.progress>0 && item.progress<100) {
|
|
||||||
this.$router.push({path:'/course/studyindex',query:{id:item.courseId}})
|
|
||||||
// } else {
|
|
||||||
// this.$router.push({path:'/course/detail',query:{id:item.courseId}})
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
// getMyLearning() {
|
|
||||||
// let params = {
|
|
||||||
// type:this.params.courseType,
|
|
||||||
// page:this.pageIndex,
|
|
||||||
// size:200
|
|
||||||
// }
|
|
||||||
// apiBoeCourse.myLearning(params).then(res=>{
|
|
||||||
// if(res.status == 200) {
|
|
||||||
// res.result.dataList.forEach(item => {
|
|
||||||
// let num = item.completeProgress.replace('%',"");
|
|
||||||
// item.completeProgress = Number(num);
|
|
||||||
// item.url = item.cover[0].url;
|
|
||||||
// });
|
|
||||||
// // if(this.page == 1) {
|
|
||||||
// this.dataList = res.result.dataList;
|
|
||||||
// // } else {
|
|
||||||
// // this.dataList.push(...res.result.dataList);
|
|
||||||
// // }
|
|
||||||
|
|
||||||
// this.isNextPage = res.result.isNextPage;
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// },
|
|
||||||
reset(){
|
reset(){
|
||||||
this.params.courseName = '',
|
this.params.courseName = '',
|
||||||
this.params.courseType = '',
|
this.params.courseType = '',
|
||||||
@@ -357,55 +230,16 @@ computed: {
|
|||||||
this.couresList = this.dataList;
|
this.couresList = this.dataList;
|
||||||
this.courseType = '';
|
this.courseType = '';
|
||||||
this.status = '';
|
this.status = '';
|
||||||
},
|
this.findStudys();
|
||||||
searchData() {
|
|
||||||
this.loading=false;//因为是页面搜索,所以直接设置为false
|
|
||||||
this.page.pageIndex = 1;
|
|
||||||
this.isListOne = true;
|
|
||||||
let list = this.dataList;
|
|
||||||
if(this.courseType == '1') {
|
|
||||||
this.params.courseType = '';
|
|
||||||
} else {
|
|
||||||
this.params.courseType = this.courseType;
|
|
||||||
}
|
|
||||||
let type;
|
|
||||||
if(this.params.courseType == 20) {
|
|
||||||
type = 10;
|
|
||||||
}
|
|
||||||
if(this.status == '0') {
|
|
||||||
this.params.status = '';
|
|
||||||
} else {
|
|
||||||
this.params.status = this.status;
|
|
||||||
}
|
|
||||||
if(this.params.courseType != '') {
|
|
||||||
list= list.filter(item => {
|
|
||||||
if(item.courseType === this.params.courseType || item.courseType === type) {
|
|
||||||
return item;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if(this.params.status !== '') {
|
|
||||||
list= list.filter(item => {
|
|
||||||
if(item.status === this.params.status){
|
|
||||||
return item;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if(this.params.courseName !== '') {
|
|
||||||
list= list.filter(item => {
|
|
||||||
return item.courseName.toLowerCase()
|
|
||||||
.indexOf(this.params.courseName.toLowerCase()) > -1;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.couresList = list;
|
|
||||||
|
|
||||||
},
|
},
|
||||||
handleSizeChange(val) {
|
handleSizeChange(val) {
|
||||||
this.page.pageSize = val;
|
this.page.pageSize = val;
|
||||||
this.page.pageIndex = 1;
|
this.page.pageIndex = 1;
|
||||||
|
this.findStudys();
|
||||||
},
|
},
|
||||||
handleCurrentChange(val) {
|
handleCurrentChange(val) {
|
||||||
this.page.pageIndex = val;
|
this.page.pageIndex = val;
|
||||||
|
this.findStudys();
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user