|
@@ -36,7 +36,7 @@ export default {
|
|
|
async created() {
|
|
|
await this.toGetSite(); //获取主站信息
|
|
|
this.loadMenu(); //获取菜单信息
|
|
|
- this.toGetModule(); //获取模块信息
|
|
|
+ // this.toGetModule(); //获取模块信息
|
|
|
this.toGetNews(); //获取数据
|
|
|
},
|
|
|
computed: {
|
|
@@ -132,75 +132,75 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
//模块
|
|
|
- async loadModule() {
|
|
|
- let modules = sessionStorage.getItem('modules');
|
|
|
- for (const item of modules) {
|
|
|
- if (item.category === 'member') {
|
|
|
- this.$set(this, `modules`, JSON.parse(modules));
|
|
|
- return;
|
|
|
- }
|
|
|
- }
|
|
|
- this.toGetMenu();
|
|
|
- },
|
|
|
- async toGetModule() {
|
|
|
- let result = await this.getModule({ type: `list` });
|
|
|
- if (result.errcode === 0) {
|
|
|
- sessionStorage.setItem('modules', JSON.stringify(result.data));
|
|
|
- this.$set(this, `modules`, result.data);
|
|
|
- this.finishedModule();
|
|
|
- }
|
|
|
- },
|
|
|
- async finishedModule() {
|
|
|
- let modules = JSON.parse(JSON.stringify(this.modules));
|
|
|
- let object = {};
|
|
|
- for (const item of modules) {
|
|
|
- if (item.category === 'member') {
|
|
|
- if (`${item.is_use}` === `0`) {
|
|
|
- let res = await this.completeModules(item);
|
|
|
- item.children = res;
|
|
|
- object = item;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- for (const item of object.children) {
|
|
|
- this.$set(this, `${item.category}List`, item);
|
|
|
- }
|
|
|
- },
|
|
|
- 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 = `/memberList/module/${col.content_id}`;
|
|
|
- col.children = await this.completeColumn(col);
|
|
|
- } else if (col.type === `column`) {
|
|
|
- col.path = `/memberList/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 loadModule() {
|
|
|
+ // let modules = sessionStorage.getItem('modules');
|
|
|
+ // for (const item of modules) {
|
|
|
+ // if (item.category === 'member') {
|
|
|
+ // this.$set(this, `modules`, JSON.parse(modules));
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // this.toGetMenu();
|
|
|
+ // },
|
|
|
+ // async toGetModule() {
|
|
|
+ // let result = await this.getModule({ type: `list` });
|
|
|
+ // if (result.errcode === 0) {
|
|
|
+ // sessionStorage.setItem('modules', JSON.stringify(result.data));
|
|
|
+ // this.$set(this, `modules`, result.data);
|
|
|
+ // this.finishedModule();
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // async finishedModule() {
|
|
|
+ // let modules = JSON.parse(JSON.stringify(this.modules));
|
|
|
+ // let object = {};
|
|
|
+ // for (const item of modules) {
|
|
|
+ // if (item.category === 'member') {
|
|
|
+ // if (`${item.is_use}` === `0`) {
|
|
|
+ // let res = await this.completeModules(item);
|
|
|
+ // item.children = res;
|
|
|
+ // object = item;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // for (const item of object.children) {
|
|
|
+ // this.$set(this, `${item.category}List`, item);
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // 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 = `/memberList/module/${col.content_id}`;
|
|
|
+ // col.children = await this.completeColumn(col);
|
|
|
+ // } else if (col.type === `column`) {
|
|
|
+ // col.path = `/memberList/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 toGetNews({ skip = 0, limit = 8 } = {}) {
|
|
|
let result = await this.getNews({ type: 'list', data: { parent_id: this.id, skip: skip, limit: limit } });
|