- {{item.aname}}{{item.cusInfo}}
+ {{item.aname}}{{item.cusInfo}}
{{item.eventTime}}
-
+
隐藏
-
+
{{ item.authorInfo.sign }}
-
{{ orgDomainTranslate(item.info.orgDomain) }}
-
{{ orgDomainTranslate(item.info.orgDomainParent) }}
+
{{ orgDomainTranslate(item.info.orgDomain) }}
+
{{ orgDomainTranslate(item.info.orgDomainParent) }}
{{ majorTypeTranslate(item) }}
{{ item.info.keyword1 }}
{{ item.info.keyword2 }}
@@ -36,7 +37,7 @@
{{ item.info.keyword4 }}
{{ item.info.keyword5 }}
-
+
{{item.info.summary}}
+
diff --git a/src/views/homepage/page.vue b/src/views/homepage/page.vue
index 83079d17..02ee0c33 100644
--- a/src/views/homepage/page.vue
+++ b/src/views/homepage/page.vue
@@ -9,12 +9,12 @@
动态
-
-
-
-
-
-
+
+
+
+
+
+
@@ -146,7 +146,6 @@
},
methods:{
init(){
-
this.getList();
if(this.pageId == this.userInfo.aid) {
this.personal = true;
diff --git a/src/views/portal/follow/index.vue b/src/views/portal/follow/index.vue
index 9976d93c..86cba83d 100644
--- a/src/views/portal/follow/index.vue
+++ b/src/views/portal/follow/index.vue
@@ -13,38 +13,38 @@
-->
-
-
- 动态
+
+
+
+
+
+
+
+
+
-
-
-
+
+
-
-
-
+
+
-
-
-
+
+
-
-
-
+
+
-
-
-
+
+
-
-
-
+
+
-
-
+
+
-
+
+
+
+
+
-
@@ -70,6 +81,16 @@
import ArticleList from "@/components/HomePage/articleList.vue"
import FollowList from "@/components/HomePage/followList.vue"
import BookList from "@/components/HomePage/bookList.vue"
+ import apiFollow from "@/api/phase2/userfollow.js"
+ import apiStat from "@/api/phase2/stat.js"
+ import apiArticle from '@/api/modules/article.js'
+ import apiCases from '@/api/modules/cases.js'
+ import apiQa from '@/api/modules/qa.js'
+ import apiCourse from '@/api/modules/course.js'
+ import apiNote from '@/api/phase2/note.js'
+ import apiUser from "@/api/system/user.js";
+ import {cutFullName} from "@/utils/tools.js";
+ import { mapGetters,mapActions } from 'vuex';
export default{
components:{portalHeader,UcHeader,CaseList,CourseList,NoteList,PutList,AnswerList,ArticleList,FollowList,BookList},
@@ -77,12 +98,366 @@
return{
input:'',
activeName:'first',
+ page:{
+ pageIndex:1,
+ pageSize:10,
+ count:0
+ },
+ input:'',
+ activeName:'',
+ pageId:'',
+ // pageList:[],
+ casePageList:[],
+ notePageList:[],
+ articlePageList:[],
+ qaPageList:[],
+ answerPageList:[],
+ cousrePageList:[],
+ allPageList:[],
+ personal:true,
+ orgData:[],
+ Profess:[],
+ ids:[],
}
},
+ computed: {
+ ...mapGetters(['userInfo','majorTypeMap','orgDomainMap','attention']),
+ },
+ created() {
+ apiFollow.list().then(res=>{
+ if(res.status == 200) {
+ this.ids = res.result.map(item=>item.followId);
+ this.getList()
+ }
+ })
+ this.loadMajorType();
+ this.loadOrgDomain();
+ },
methods:{
- handleClick() {
+ emitInput(){
- }
+ },
+ ...mapActions({
+ loadMajorType:'majorType/loadMajorTypes',
+ loadOrgDomain:'orgDomain/loadOrgDomains'
+ }),
+ dynamicHide(id){
+ apiStat.dynamicHide(id).then(res=>{
+ if(res.status == 200){
+ this.$message.success('动态隐藏成功')
+ this.getList();
+ } else {
+ this.$message.error(res.message);
+ }
+ })
+ },
+ handleSizeChange(val) {
+ this.page.pageSize = val;
+ this.page.pageIndex = 1;
+ this.getList();
+ },
+ handleCurrentChange(val) {
+ this.page.pageIndex = val;
+ this.getList();
+ },
+ getList(ids) {
+ let data = {
+ pageIndex:this.page.pageIndex,
+ pageSize:this.page.pageSize,
+ contentType:this.activeName == 0? '':this.activeName,//内容类型
+ aids:this.ids // 数组
+ }
+ apiStat.userDynamicfollows(data).then(res=>{
+ if(res.status == 200) {
+ this.page.count = res.result.count;
+ let ids = res.result.list.map(item=>item.contentId);
+ const noReapetIds = [...new Set(ids)];
+ res.result.list.forEach(item=>{
+ item.info = {};
+ item.authorInfo = {
+ aid: "",
+ name: "",
+ orgInfo: "",
+ avatar: "",
+ sex: null
+ }
+ item.isAll = false;
+ })
+ if(this.activeName == 0) {// 动态处理
+ this.getAllList(res.result.list)
+ }
+ if(this.activeName == 1){
+ this.cousrePageList = res.result.list
+ this.getCourse(noReapetIds,res.result.list);
+ }
+ if(this.activeName == 2) {
+ this.articlePageList = res.result.list;
+ this.getArticle(noReapetIds,res.result.list);
+ }
+ if(this.activeName == 3) {
+ this.casePageList = res.result.list;
+ this.getCase(noReapetIds,res.result.list);
+ console.log(this.casePageList,'this.casePageList');
+ }
+ if(this.activeName == 6) { // 笔记
+ this.getNote(noReapetIds,res.result.list);
+ this.notePageList = res.result.list;
+ }
+ if(this.activeName == 4) { // 提问
+ this.qaPageList = res.result.list;
+ this.getQa(noReapetIds,res.result.list);
+ }
+ if(this.activeName == 5) { // 回答
+ this.answerPageList = res.result.list;
+ this.getAnswer(ids,res.result.list);
+ }
+ }
+ })
+ },
+ getAllList(list) {
+ this.allPageList = [];
+ let casePageList=[];
+ let notePageList=[];
+ let articlePageList=[];
+ let qaPageList=[];
+ let answerPageList=[];
+ let cousrePageList=[];
+ list.forEach(item=>{
+ if(item.contentType == 1) {
+ cousrePageList.push(item);
+ }
+ if(item.contentType == 2) {
+ articlePageList.push(item);
+ }
+ if(item.contentType == 3) {
+ casePageList.push(item);
+ }
+ if(item.contentType == 4) {
+ qaPageList.push(item);
+ }
+ if(item.contentType == 5) {
+ answerPageList.push(item);
+ }
+ if(item.contentType == 6) {
+ notePageList.push(item);
+ }
+ })
+ let caseIds = casePageList.map(item=>item.contentId);
+ const noReapetCaseIds = [...new Set(caseIds)];
+ let articleIds = articlePageList.map(item=>item.contentId);
+ const noReapetArticleIds = [...new Set(articleIds)];
+ let cousreIds = cousrePageList.map(item=>item.contentId);
+ const noReapetCousreIds = [...new Set(cousreIds)];
+ let qaIds = qaPageList.map(item=>item.contentId);
+ const noReapetQaIds = [...new Set(qaIds)];
+ let anwerIds = answerPageList.map(item=>item.contentId);
+ const noReapetAnwerIds = [...new Set(anwerIds)];
+ let noteIds = notePageList.map(item=>item.contentId);
+ const noReapetNoteIds = [...new Set(noteIds)];
+ if(noReapetCaseIds.length > 0) {
+ this.getCase(noReapetCaseIds,casePageList);
+ }
+ if(noReapetArticleIds.length > 0) {
+ this.getArticle(noReapetArticleIds,articlePageList);
+ }
+ if(noReapetCousreIds.length > 0) {
+ this.getCourse(noReapetCousreIds,cousrePageList);
+ }
+ if(noReapetQaIds.length > 0) {
+ this.getQa(noReapetQaIds,qaPageList);
+ }
+ if(noReapetAnwerIds.length > 0) {
+ this.getAnswer(noReapetAnwerIds,answerPageList);
+ }
+ if(noReapetNoteIds.length > 0) {
+ this.getNote(noReapetNoteIds,notePageList);
+ }
+ this.allPageList.push(...casePageList,...articlePageList,...cousrePageList,...qaPageList,...answerPageList,...notePageList);
+ this.allPageList.sort(this.pcompare("eventTime", false))
+ },
+ pcompare(prop, rev) {
+ if (rev === undefined) {
+ rev = 1;
+ } else {
+ rev = rev ? 1 : -1;
+ }
+ return function(obj1, obj2) {
+ let val1 = obj1[prop],
+ val2 = obj2[prop];
+ return val1 < val2 ? rev * -1 : rev * 1;
+ };
+ },
+ getAnswer(ids,list){
+ if(ids.length == 0){
+ return
+ }
+ apiQa.answerIds(ids).then(res=>{
+ if(res.status == 200) {
+ list.forEach((item, index) => {
+ res.result.some(con => {
+ if (con.id == item.contentId) {
+ item.info = con;
+ return true;
+ } else {
+ return false;
+ }
+ });
+ });
+ }
+ })
+ },
+ getQa(ids,list){
+ apiQa.ids(ids).then(res=>{
+ if(res.status == 200) {
+ list.forEach((item, index) => {
+ res.result.some(con => {
+ if (con.id == item.contentId) {
+ item.info = con;
+ return true;
+ } else {
+ return false;
+ }
+ });
+ });
+ }
+ })
+ },
+ getNote(ids,list) {
+ apiNote.ids(ids).then(res=>{
+ if(res.status == 200) {
+ list.forEach((item, index) => {
+ res.result.some(con => {
+ if (con.id == item.contentId) {
+ item.info = con;
+ return true;
+ } else {
+ return false;
+ }
+ });
+ });
+ }
+ })
+ },
+ getCase(ids,list){
+ apiCases.ids(ids).then(res=>{
+ if(res.status == 200) {
+ list.forEach((item, index) => {
+ res.result.some(con => {
+ if (con.id == item.contentId) {
+ item.info = con;
+ return true;
+ } else {
+ return false;
+ }
+ });
+ });
+ this.getCaseUserData(list);
+ }
+ })
+ },
+ getCaseUserData(list) {
+ // let ids = caseList.map((item, index) => {
+ // return item.info.authorId;
+ // });
+ // const noReapetIds = [...new Set(ids)];
+ let data = list.filter((item, index) => {
+ return item.info && item.info.authorId != null;
+ });
+ let ids = data.map((item, index) => {
+ return item.info.authorId;
+ });
+ const noReapetIds = [...new Set(ids)];
+ apiUser.getByIds(noReapetIds).then(res => {
+ if (res.status == 200) {
+ list.forEach((item, index) => {
+ res.result.some(author => {
+ if (author.aid == item.info.authorId) {
+ item.authorInfo = author;
+ author.orgInfo=cutFullName(author.orgInfo,1);
+ return true;
+ } else {
+ return false;
+ }
+ });
+ });
+ } else {
+ this.$message.error(res.message);
+ }
+ });
+ },
+ getArticle(ids,list){
+ apiArticle.ids(ids).then(res=>{
+ if(res.status == 200) {
+ list.forEach((item, index) => {
+ res.result.some(con => {
+ if (con.id == item.contentId) {
+ item.info = con;
+ return true;
+ } else {
+ return false;
+ }
+ });
+ });
+ this.getArticleUserData(list);
+ }
+ })
+ },
+ getArticleUserData(list) {
+ let data = list.filter((item, index) => {
+ return item.info && item.info.sysCreateAid != null;
+ });
+ let ids = data.map((item, index) => {
+ return item.info.sysCreateAid;
+ });
+ const noReapetIds = [...new Set(ids)];
+ apiUser.getByIds(noReapetIds).then(res => {
+ if (res.status == 200) {
+ list.forEach((item, index) => {
+ res.result.some(author => {
+ if (author.aid == item.info.sysCreateAid) {
+ item.authorInfo = author;
+ author.orgInfo=cutFullName(author.orgInfo,1);
+ return true;
+ } else {
+ return false;
+ }
+ });
+ });
+ } else {
+ this.$message.error(res.message);
+ }
+ });
+ },
+ getCourse(ids,list) {
+ apiCourse.ids(ids).then(res=>{
+ if(res.status == 200) {
+ list.forEach((item, index) => {
+ res.result.some(con => {
+ if (con.id == item.contentId) {
+ item.info = con;
+ return true;
+ } else {
+ return false;
+ }
+ });
+ });
+ // this.getArticleUserData(list);
+ }
+ })
+ },
+ handleClick() {
+ if(this.activeName == '7') {
+ //单独的分页,所以这里不与当前页面的分页共用
+ this.$refs.followList.resetActive();
+ this.$refs.followList.getPage();
+ return
+ }
+ if(this.activeName == '8') {
+ this.page.count = 0;
+ return
+ }
+ this.getList();
+ }
}
}
@@ -93,7 +468,7 @@
}
.follow-page{
background: #FFFFFF;
- height: 100vh;
+ // height: 100%;
::v-deep .el-tabs__active-bar{
height: 4px;
border-radius: 3px;