mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-12 12:26:44 +08:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@@ -21,10 +21,38 @@
|
|||||||
<el-button type="primary" @click="resData" icon="el-icon-refresh-right" style="padding: 10px 15px;">重置</el-button>
|
<el-button type="primary" @click="resData" icon="el-icon-refresh-right" style="padding: 10px 15px;">重置</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
|
|
||||||
<el-tabs v-model="tabName" @tab-click="changeTab" style="margin-top:14px">
|
<el-tabs v-model="tabName" @tab-click="changeTab" style="margin-top:14px">
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 全部 -->
|
||||||
|
<el-tab-pane label="全部" name="all">
|
||||||
|
<div v-for="(item, index) in dataList.list">
|
||||||
|
<course-items type="toMy" v-if="item.type==1" :items="[item]" @confirm="confirm"></course-items>
|
||||||
|
<case-items type="toMy" v-if="item.type==3" :items="[item]" @confirm="confirm" ></case-items>
|
||||||
|
<article-items type="toMy" v-if="item.type==2" @confirm="confirm" :items="[item]"></article-items>
|
||||||
|
<qa-items type="toMy" v-if="item.type==4" :items="[item]" @confirm="confirm" :collect="true" :share="false" :remove="false" :edit="false"></qa-items>
|
||||||
|
</div>
|
||||||
|
<!-- v-if="courseList.count>courseList.pageSize" -->
|
||||||
|
<div style="text-align: center;margin-top:57px">
|
||||||
|
<el-pagination
|
||||||
|
background
|
||||||
|
@size-change="handleSizeChange"
|
||||||
|
@current-change="handleCurrentChange"
|
||||||
|
:current-page="dataList.pageIndex"
|
||||||
|
:page-sizes="[10, 20, 30, 40]"
|
||||||
|
:page-size="dataList.pageSize"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
:total="dataList.count"
|
||||||
|
></el-pagination>
|
||||||
|
</div>
|
||||||
|
</el-tab-pane>
|
||||||
|
|
||||||
|
|
||||||
<el-tab-pane label="课程" name="course">
|
<el-tab-pane label="课程" name="course">
|
||||||
<div style="min-height: 500px;">
|
<div style="min-height: 500px;">
|
||||||
<course-items @confirm="confirm" :items="courseList.list"></course-items>
|
<course-items @confirm="confirm" type="toMy" :items="courseList.list"></course-items>
|
||||||
<!-- v-if="courseList.count>courseList.pageSize" -->
|
<!-- v-if="courseList.count>courseList.pageSize" -->
|
||||||
<div v-if="courseList.list.length > 0" style="text-align: center;margin-top:57px">
|
<div v-if="courseList.list.length > 0" style="text-align: center;margin-top:57px">
|
||||||
<el-pagination
|
<el-pagination
|
||||||
@@ -50,7 +78,7 @@
|
|||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="案例" name="case">
|
<el-tab-pane label="案例" name="case">
|
||||||
<div style="min-height: 500px;">
|
<div style="min-height: 500px;">
|
||||||
<case-items @confirm="confirm" :items="caseList.list"></case-items>
|
<case-items @confirm="confirm" type="toMy" :items="caseList.list"></case-items>
|
||||||
<div v-if="caseList.list.length > 0" style="text-align: center;margin-top:57px;">
|
<div v-if="caseList.list.length > 0" style="text-align: center;margin-top:57px;">
|
||||||
<el-pagination
|
<el-pagination
|
||||||
background
|
background
|
||||||
@@ -73,7 +101,7 @@
|
|||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="文章" name="article">
|
<el-tab-pane label="文章" name="article">
|
||||||
<div style="min-height: 500px;">
|
<div style="min-height: 500px;">
|
||||||
<article-items @confirm="confirm" :items="articleList.list"></article-items>
|
<article-items @confirm="confirm" type="toMy" :items="articleList.list"></article-items>
|
||||||
<!-- v-if="articleList.count>articleList.pageSize" -->
|
<!-- v-if="articleList.count>articleList.pageSize" -->
|
||||||
<div v-if="articleList.list.length > 0" style="text-align: center;margin-top:57px;">
|
<div v-if="articleList.list.length > 0" style="text-align: center;margin-top:57px;">
|
||||||
<el-pagination
|
<el-pagination
|
||||||
@@ -97,7 +125,7 @@
|
|||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="问答" name="qa">
|
<el-tab-pane label="问答" name="qa">
|
||||||
<div>
|
<div>
|
||||||
<qa-items @confirm="confirm" :items="qaList.list"></qa-items>
|
<qa-items @confirm="confirm" type="toMy" :items="qaList.list"></qa-items>
|
||||||
<!-- v-if="qaList.count>qaList.pageSize" -->
|
<!-- v-if="qaList.count>qaList.pageSize" -->
|
||||||
<div v-if="qaList.list.length > 0" style="text-align: center;margin-top:57px;">
|
<div v-if="qaList.list.length > 0" style="text-align: center;margin-top:57px;">
|
||||||
<el-pagination
|
<el-pagination
|
||||||
@@ -139,7 +167,7 @@
|
|||||||
data(){
|
data(){
|
||||||
return {
|
return {
|
||||||
isRead: '',
|
isRead: '',
|
||||||
tabName:'course',
|
tabName:'all',
|
||||||
keyword:'',
|
keyword:'',
|
||||||
courseIndex:null,
|
courseIndex:null,
|
||||||
qaIndex:null,
|
qaIndex:null,
|
||||||
@@ -168,10 +196,50 @@
|
|||||||
count: 0,
|
count: 0,
|
||||||
list: []
|
list: []
|
||||||
},
|
},
|
||||||
|
dataList: {
|
||||||
|
pageIndex: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
keyword: '',
|
||||||
|
count: 0,
|
||||||
|
list: []
|
||||||
|
},
|
||||||
isSearh:false,
|
isSearh:false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
|
findAll(){
|
||||||
|
let { pageIndex, pageSize } = this.dataList;
|
||||||
|
let query = { pageIndex, pageSize, keyword: this.keyword, isRead: this.isRead };
|
||||||
|
apiShares.findMeShare(query).then(res=>{
|
||||||
|
if(res.status == 200){
|
||||||
|
console.log(res);
|
||||||
|
this.dataList.count = res.result.count;
|
||||||
|
res.result.list.forEach(item => {
|
||||||
|
if(item.type == 4) {
|
||||||
|
item.question = {isResolve:false,title:'',content:'',bestAnswer:''};
|
||||||
|
item.question.isResolve=item.isResolve;
|
||||||
|
item.question.title=item.title;
|
||||||
|
item.question.content=item.content;
|
||||||
|
item.question.bestAnswer=item.bestAnswer;
|
||||||
|
item.question.id=item.id;
|
||||||
|
}
|
||||||
|
if(item.type == 3){
|
||||||
|
item.cases = {title:'',summary:''};
|
||||||
|
item.cases.title=item.title;
|
||||||
|
item.cases.title=item.summary;
|
||||||
|
item.cases.id=item.id;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.dataList.list = res.result.list;
|
||||||
|
}else {
|
||||||
|
this.$message.error(res.message);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
queryData(){
|
queryData(){
|
||||||
this.qaList.pageIndex = 1;
|
this.qaList.pageIndex = 1;
|
||||||
this.articleList.pageIndex = 1;
|
this.articleList.pageIndex = 1;
|
||||||
@@ -189,6 +257,9 @@
|
|||||||
if (this.tabName == 'course') {
|
if (this.tabName == 'course') {
|
||||||
this.findCourse();
|
this.findCourse();
|
||||||
}
|
}
|
||||||
|
if (this.tabName == 'all') {
|
||||||
|
this.findAll();
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
resData() {
|
resData() {
|
||||||
@@ -200,20 +271,21 @@
|
|||||||
this.queryData();
|
this.queryData();
|
||||||
this.isSearh = false;
|
this.isSearh = false;
|
||||||
},
|
},
|
||||||
changeIndex(value){
|
// changeIndex(value){
|
||||||
if(this.tabName=='qa'){
|
// if(this.tabName=='qa'){
|
||||||
this.qaIndex=value
|
// this.qaIndex=value
|
||||||
this.findQa();
|
// this.findQa();
|
||||||
}
|
// }
|
||||||
if(this.tabName=='article'){
|
// if(this.tabName=='article'){
|
||||||
this.articleIndex=value
|
// this.articleIndex=value
|
||||||
this.findArticle();
|
// this.findArticle();
|
||||||
}
|
// }
|
||||||
if(this.tabName=='course'){
|
// if(this.tabName=='course'){
|
||||||
this.courseIndex=value
|
// this.courseIndex=value
|
||||||
this.findCourse();
|
// this.findCourse();
|
||||||
}
|
// }
|
||||||
},
|
|
||||||
|
// },
|
||||||
changeTab(tab) {
|
changeTab(tab) {
|
||||||
if (tab.name == 'qa') {
|
if (tab.name == 'qa') {
|
||||||
this.findQa();
|
this.findQa();
|
||||||
@@ -227,6 +299,9 @@
|
|||||||
console.log(tab.name,'tab.name');
|
console.log(tab.name,'tab.name');
|
||||||
if (tab.name == 'case') {
|
if (tab.name == 'case') {
|
||||||
this.findCase();
|
this.findCase();
|
||||||
|
}
|
||||||
|
if (tab.name == 'all') {
|
||||||
|
this.findAll();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//分页点击事件
|
//分页点击事件
|
||||||
@@ -247,6 +322,10 @@
|
|||||||
this.caseList.pageSize = value;
|
this.caseList.pageSize = value;
|
||||||
this.findCase();
|
this.findCase();
|
||||||
}
|
}
|
||||||
|
if (this.tabName == 'all') {
|
||||||
|
this.dataList.pageSize = value;
|
||||||
|
this.findAll()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
//分页点击事件
|
//分页点击事件
|
||||||
handleCurrentChange(value) {
|
handleCurrentChange(value) {
|
||||||
@@ -266,6 +345,10 @@
|
|||||||
this.caseList.pageIndex = value;
|
this.caseList.pageIndex = value;
|
||||||
this.findCase();
|
this.findCase();
|
||||||
}
|
}
|
||||||
|
if (this.tabName == 'all') {
|
||||||
|
this.dataList.pageIndex = value;
|
||||||
|
this.findAll();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 案例数据查询
|
// 案例数据查询
|
||||||
findCase() {
|
findCase() {
|
||||||
@@ -397,6 +480,10 @@
|
|||||||
if (this.tabName == 'course') {
|
if (this.tabName == 'course') {
|
||||||
this.findCourse();
|
this.findCourse();
|
||||||
}
|
}
|
||||||
|
if (this.tabName == 'all') {
|
||||||
|
this.findAll();
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user