From f08af49764c05e77d41ac773db7825751e9a0961 Mon Sep 17 00:00:00 2001 From: zhaofang <752743406@qq.com> Date: Wed, 8 Jun 2022 17:21:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E4=BA=AB=E7=BB=99=E6=88=91=E7=9A=84?= =?UTF-8?q?=E5=85=A8=E9=83=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/PortalHeader.vue | 10 ++--- src/views/share/ToList.vue | 72 ++++++++++++++++++++++++++++----- 2 files changed, 68 insertions(+), 14 deletions(-) diff --git a/src/components/PortalHeader.vue b/src/components/PortalHeader.vue index b455a326..91424e95 100644 --- a/src/components/PortalHeader.vue +++ b/src/components/PortalHeader.vue @@ -29,7 +29,7 @@ - + @@ -51,7 +51,7 @@
- +
@@ -114,7 +114,7 @@ export default { computed: { ...mapGetters(['userInfo', 'userMsg']), - + avatarText(){ return userAvatarText(this.userInfo.name); } @@ -335,7 +335,7 @@ export default { font-size: 25px !important; margin: 0 !important; padding: 0 !important -} +} .message-count a { color: #858d99; font-size: 24px; @@ -357,7 +357,7 @@ export default { border-radius: 50%; img{ border-radius: 50%; - + width: 40px; height: 40px; } diff --git a/src/views/share/ToList.vue b/src/views/share/ToList.vue index b56aead8..d5336baf 100644 --- a/src/views/share/ToList.vue +++ b/src/views/share/ToList.vue @@ -18,13 +18,14 @@ -
- --> - - +
@@ -155,7 +154,7 @@ export default { return { isSearh:false, isRead: '', - tabName: 'course', + tabName: 'all', keyword: '', courseIndex: null, qaIndex: null, @@ -198,6 +197,7 @@ export default { this.qaList.pageIndex = 1; this.articleList.pageIndex = 1; this.courseList.pageIndex = 1; + this.dataList.pageIndex = 1; this.isSearh= true; if (this.tabName == 'qa') { this.findQa(); @@ -211,6 +211,9 @@ export default { if (this.tabName == 'case') { this.findCase(); } + if (this.tabName == 'all') { + this.findAll(); + } }, resData() { @@ -219,6 +222,7 @@ export default { this.qaList.pageIndex = 1; this.articleList.pageIndex = 1; this.courseList.pageIndex = 1; + this.dataList.pageIndex = 1; this.queryData(); this.isSearh= false; }, @@ -249,6 +253,9 @@ export default { if (tab.name == 'case') { this.findCase(); } + if (tab.name == 'all') { + this.findAll(); + } }, //分页点击事件 handleSizeChange(value) { @@ -268,6 +275,10 @@ export default { this.caseList.pageSize = value; this.findCase() } + if (this.tabName == 'all') { + this.dataList.pageSize = value; + this.findAll() + } }, //分页点击事件 handleCurrentChange(value) { @@ -287,8 +298,39 @@ export default { this.caseList.pageIndex = value; this.findCase(); } + if (this.tabName == 'all') { + this.dataList.pageIndex = value; + this.findAll(); + } }, + findAll(){ + let { pageIndex, pageSize } = this.dataList; + let query = { pageIndex, pageSize, keyword: this.keyword, isRead: this.isRead }; + apiShares.findShareMe(query).then(res=>{ + if(res.status == 200) { + 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; + } + if(item.type == 3){ + item.cases = {title:'',summary:''}; + item.cases.title=item.title; + item.cases.title=item.summary; + } + }); + this.dataList.list = res.result.list; + } else { + this.$message.error(res.message); + } + }) + }, // 案例 findCase(){ let { pageIndex, pageSize } = this.caseList; @@ -396,6 +438,12 @@ export default { if (this.tabName == 'course') { this.findCourse(); } + if (this.tabName == 'case') { + this.findCase(); + } + if (this.tabName == 'all') { + this.findAll(); + } } }, mounted() { @@ -408,6 +456,12 @@ export default { if (this.tabName == 'course') { this.findCourse(); } + if (this.tabName == 'case') { + this.findCase(); + } + if (this.tabName == 'all') { + this.findAll(); + } } };