|
@@ -44,7 +44,7 @@ export default {
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
...mapMutations(['setLoading']),
|
|
...mapMutations(['setLoading']),
|
|
- ...mapActions(['siteOperation', 'columnOperation', 'newsOperation']),
|
|
|
|
|
|
+ ...mapActions(['siteOperation', 'columnOperation', 'newsOperation', 'getAllNewsInfo']),
|
|
async getSite() {
|
|
async getSite() {
|
|
let site = sessionStorage.getItem('site');
|
|
let site = sessionStorage.getItem('site');
|
|
if (!site) {
|
|
if (!site) {
|
|
@@ -72,14 +72,20 @@ export default {
|
|
data.parent_id = news_type === '1' ? item.id : item.content_id;
|
|
data.parent_id = news_type === '1' ? item.id : item.content_id;
|
|
let res = await this.newsOperation({ type: 'list', data: data });
|
|
let res = await this.newsOperation({ type: 'list', data: data });
|
|
if (`${res.errcode}` === '0') {
|
|
if (`${res.errcode}` === '0') {
|
|
- for (const val of res.data) {
|
|
|
|
- let result = await this.newsOperation({ type: 'search', data: { id: val.id } });
|
|
|
|
- if (`${result.errcode}` === '0') {
|
|
|
|
- val.content = result.data.content;
|
|
|
|
- } else {
|
|
|
|
- this.$message.error(result.errmsg ? result.errmsg : 'error');
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ // for (const val of res.data) {
|
|
|
|
+ // let result = await this.newsOperation({ type: 'search', data: { id: val.id } });
|
|
|
|
+ // if (`${result.errcode}` === '0') {
|
|
|
|
+ // val.content = result.data.content;
|
|
|
|
+ // } else {
|
|
|
|
+ // this.$message.error(result.errmsg ? result.errmsg : 'error');
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ let infos = await this.getAllNewsInfo(res.data.map(i => i._id));
|
|
|
|
+ res.data.map(i => {
|
|
|
|
+ let content = infos.find(f => f._id === i._id);
|
|
|
|
+ i.content = _.get(content, `content`);
|
|
|
|
+ return i;
|
|
|
|
+ });
|
|
return res;
|
|
return res;
|
|
} else {
|
|
} else {
|
|
this.$message.error(res.errmsg ? res.errmsg : 'error');
|
|
this.$message.error(res.errmsg ? res.errmsg : 'error');
|
|
@@ -96,7 +102,7 @@ export default {
|
|
} else {
|
|
} else {
|
|
target.page = 1;
|
|
target.page = 1;
|
|
target.skip = 0;
|
|
target.skip = 0;
|
|
- target.limit = this.$limit || 10;
|
|
|
|
|
|
+ target.limit = this.$limit || 6;
|
|
}
|
|
}
|
|
//数据处理
|
|
//数据处理
|
|
if (target.type === 'bugList' || target.type === 'column') {
|
|
if (target.type === 'bugList' || target.type === 'column') {
|