From 86ef8f2f2a00561aaf89022474554077007355f4 Mon Sep 17 00:00:00 2001 From: zhaofang <752743406@qq.com> Date: Tue, 7 Jun 2022 15:23:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A1=88=E4=BE=8B=E6=90=9C=E7=B4=A2=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/UserCenter/menu.vue | 6 +- src/views/portal/case/Index.vue | 148 ++++++++++++++--------------- 2 files changed, 74 insertions(+), 80 deletions(-) diff --git a/src/components/UserCenter/menu.vue b/src/components/UserCenter/menu.vue index 50f324f8..8ce03334 100644 --- a/src/components/UserCenter/menu.vue +++ b/src/components/UserCenter/menu.vue @@ -78,10 +78,10 @@ 教师管理 - + 受众管理 @@ -427,7 +427,7 @@ export default { height: 36px; } .oneheight{ - + height: 36px; line-height: 36px; } diff --git a/src/views/portal/case/Index.vue b/src/views/portal/case/Index.vue index 1ff6002d..47b59e24 100644 --- a/src/views/portal/case/Index.vue +++ b/src/views/portal/case/Index.vue @@ -7,44 +7,37 @@ - + - - + - + --> -
组织领域
- - 全部 - {{ item.name}} - + + 全部 + {{ item.name}}
- +
- +
@@ -56,45 +49,17 @@ 专业分类
- - + -
@@ -102,15 +67,8 @@
- - - + 最热 @@ -118,8 +76,6 @@ - - @@ -137,9 +93,7 @@
- {{item.summary}} -
@@ -270,6 +224,7 @@ import author from '@/components/Portal/authorInfo.vue'; import apiCase from '@/api/modules/cases.js'; import apiUser from '@/api/system/user.js'; import apiSearchterm from "@/api/modules/searchterm.js"; +import { deepClone } from "../../../utils"; import apiDict from "@/api/modules/dict.js" export default { name: 'index', @@ -313,8 +268,10 @@ export default { pageIndex:1, pageSize:10, orderField:'', - breCommend:null, - keyWord:'' + // breCommend:null, + keyWord:'', + majorType:null,//专业分类 + orgDomain:null,// 组织领域 }, keyWord:'', anking: 2, @@ -326,7 +283,7 @@ export default { searchTags: [] }; }, - + mounted() { this.$nextTick(function() { this.closeSearch(); @@ -361,7 +318,7 @@ export default { window.removeEventListener("scroll",this.handleScroll); }, methods: { - + tagsClose(tag, index){ }, @@ -489,6 +446,7 @@ export default { this.getCaseData(); }, async getCaseData(){ + this.getTags(); let isTopList = []; let caseList = []; await apiCase.queryList(this.queryCondition).then(res=>{ @@ -504,7 +462,7 @@ export default { }) if(this.queryCondition.pageIndex == 1) { this.caseList.list =[]; - } + } this.caseList.list.push(...isTopList,...caseList); this.caseList.count=res.result.count; this.getCaseUserData(res.result.list) @@ -515,6 +473,42 @@ export default { }).catch(err=>{ console.log(err) }) + }, + getTags() { + this.searchTags = []; + let caseData = deepClone(this.queryCondition); + for (let i in caseData) { + if ( + caseData[i] !== "" && + i !== "pageIndex" && + i !== "pageSize" && + i !== "orderField" && + caseData[i] !== null && + caseData[i] !== undefined + ) { + if(caseData[i] !== '0') { + this.searchTags.push( + caseData[i] + ); + } + } + } + }, + tagsClose(tag, index) { + for (let i in this.queryCondition) { + if (tag === this.queryCondition[i]) { + if(i == 'majorType'){ + this.queryCondition.majorType = null; + } + if(i == 'orgDomain'){ + this.queryCondition.orgDomain = null; + } + this.queryCondition[i] = ""; + + this.searchTags.splice(index, 1); + this.getCaseData(); + } + } }, getCaseUserData(caseList){ let ids=caseList.map((item,index)=>{ @@ -545,13 +539,13 @@ export default { } }) - + }, getPopularity(){ apiCase.queryPraises(5).then(res=>{ if(res.status==200){ this.Popularity=res.result - + } }) }, @@ -559,7 +553,7 @@ export default { apiCase.queryComments(5).then(res=>{ if(res.status==200){ this.Positive=res.result - + } }) }, @@ -645,7 +639,7 @@ export default { .item-line{ padding-left: 2px; height: 20px; - + background: #ddd; } @@ -819,15 +813,15 @@ export default { .ranking-card { - - + + .center{ text-align: center; } } .right-box { line-height: 25px; - + .ranking-title { } .aligh-title{