|
@@ -211,43 +211,6 @@ export default {
|
|
|
// }
|
|
|
this.$set(this, `modules`, modules);
|
|
|
},
|
|
|
- //弃用
|
|
|
- async completeModules(item) {
|
|
|
- let result = await this.getColumn({
|
|
|
- type: `list`,
|
|
|
- data: { parent_id: item.id },
|
|
|
- });
|
|
|
- if (result.errcode === 0) {
|
|
|
- let columns = result.data;
|
|
|
- for (const col of columns) {
|
|
|
- if (col.type === `bugList`) {
|
|
|
- col.path = `/newsList/module/${col.content_id}`;
|
|
|
- col.children = await this.completeColumn(col);
|
|
|
- } else if (col.type === `column`) {
|
|
|
- col.path = `/newsList/module/${col.id}`;
|
|
|
- col.children = await this.completeColumn(col);
|
|
|
- } else if (col.type === `content`) {
|
|
|
- col.path = `/detail/${col.content_id}`;
|
|
|
- }
|
|
|
- }
|
|
|
- return columns;
|
|
|
- }
|
|
|
- },
|
|
|
- //弃用
|
|
|
- async completeColumn(item) {
|
|
|
- let data = { skip: 0, limit: 8 };
|
|
|
- if (item.type === `bugList`) {
|
|
|
- data.news_type = `0`;
|
|
|
- data.parent_id = item.content_id;
|
|
|
- } else {
|
|
|
- data.news_type = `1`;
|
|
|
- data.parent_id = item.id;
|
|
|
- }
|
|
|
- let result = await this.getNews({ type: 'bugList', data: data });
|
|
|
- if (result.errcode === 0) {
|
|
|
- return result.data;
|
|
|
- }
|
|
|
- },
|
|
|
//获取招聘信息
|
|
|
async toGetJobInfo() {
|
|
|
let result = await this.getJobInfo({ type: 'list', data: { limit: 8 } });
|
|
@@ -293,6 +256,14 @@ export default {
|
|
|
modules = modules.map(item => {
|
|
|
let children = result.filter(fil => fil.parent_id === item.id);
|
|
|
item.children = children;
|
|
|
+ for (const sc of item.children) {
|
|
|
+ let schildren = _.get(sc, `children`, []);
|
|
|
+ sc.children = _.reverse(
|
|
|
+ _.sortBy(schildren, i => {
|
|
|
+ return new Date(_.get(i, `publish_time`, i.meta.createdAt)).getTime();
|
|
|
+ })
|
|
|
+ );
|
|
|
+ }
|
|
|
this.$set(this, `${item.category}List`, item);
|
|
|
return item;
|
|
|
});
|