|
@@ -7,7 +7,7 @@
|
|
|
:columnName="columnName"
|
|
|
:contentList="contentList"
|
|
|
:total="total"
|
|
|
- :columnTitle="columnTitle"
|
|
|
+ :columnTitle="columnName"
|
|
|
:policyInfo="policyInfo"
|
|
|
@clickLists="submit"
|
|
|
@fetch="fetchInfo"
|
|
@@ -31,16 +31,19 @@ export default {
|
|
|
info: {},
|
|
|
liebiaoList: [],
|
|
|
display: 'list',
|
|
|
+ // 右侧栏目标题
|
|
|
columnName: '',
|
|
|
contentList: [],
|
|
|
- total: 1,
|
|
|
+ total: 0,
|
|
|
leftId: '',
|
|
|
columnTitle: '',
|
|
|
policyInfo: {},
|
|
|
+ // 左侧栏目列表
|
|
|
+ nativeList: [],
|
|
|
}),
|
|
|
async created() {
|
|
|
this.searchSite();
|
|
|
- await this.policyColumn();
|
|
|
+ // await this.policyColumn();
|
|
|
await this.defaultColumn();
|
|
|
},
|
|
|
computed: {},
|
|
@@ -48,8 +51,8 @@ export default {
|
|
|
...mapSite(['showInfo']),
|
|
|
...mappolicyColumn({ policyColumns: 'query', policyfetch: 'fetch' }),
|
|
|
...mappolicyNews({ policyNew: 'query', newsFetch: 'fetch' }),
|
|
|
- // 查询站点信息
|
|
|
- async searchSite() {
|
|
|
+ // 查询站点信息+分类导航栏目+
|
|
|
+ async searchSite({ ...info } = {}) {
|
|
|
let res = await this.showInfo();
|
|
|
let object = JSON.parse(JSON.stringify(res.data));
|
|
|
if (object) {
|
|
@@ -57,13 +60,19 @@ export default {
|
|
|
} else {
|
|
|
this.$message.error(res.errmsg ? res.errmsg : 'error');
|
|
|
}
|
|
|
- },
|
|
|
- async policyColumn({ ...info } = {}) {
|
|
|
- const res = await this.policyColumns({ ...info });
|
|
|
+ res = await this.policyColumns({ ...info });
|
|
|
if (this.$checkRes(res)) {
|
|
|
this.$set(this, `liebiaoList`, res.data);
|
|
|
}
|
|
|
},
|
|
|
+ // async policyColumn({ ...info } = {}) {
|
|
|
+ // const res = await this.policyColumns({ ...info });
|
|
|
+ // console.log(res);
|
|
|
+ // if (this.$checkRes(res)) {
|
|
|
+ // this.$set(this, `liebiaoList`, res.data);
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ //点击左侧存储栏目id,并查询右侧信息
|
|
|
submit({ id }) {
|
|
|
this.$set(this, `leftId`, id);
|
|
|
this.display = 'list';
|
|
@@ -71,15 +80,18 @@ export default {
|
|
|
},
|
|
|
async searchRight({ skip = 0, limit = 10, column_id } = {}) {
|
|
|
const res = await this.policyNew({ column_id: this.leftId });
|
|
|
- for (const val of res.data) {
|
|
|
- const result = await this.policyfetch(val.column_id);
|
|
|
- val.column_name = result.data.name;
|
|
|
- }
|
|
|
- this.$set(this, `contentList`, res.data);
|
|
|
- this.$set(this, `total`, res.data.length);
|
|
|
- for (const val of res.data) {
|
|
|
- this.$set(this, `columnName`, val.column_name);
|
|
|
+ console.log(res);
|
|
|
+ let columnName = this.liebiaoList.find(i => i.id == this.leftId);
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$set(this, `contentList`, res.data);
|
|
|
+ this.$set(this, `total`, res.total);
|
|
|
+ this.$set(this, `columnName`, columnName.name);
|
|
|
}
|
|
|
+ // this.$set(this, `contentList`, res.data);
|
|
|
+ // this.$set(this, `total`, res.data.length);
|
|
|
+ // for (const val of res.data) {
|
|
|
+ // this.$set(this, `columnName`, val.column_name);
|
|
|
+ // }
|
|
|
},
|
|
|
async defaultColumn() {
|
|
|
if (!(this.liebiaoList.length > 0)) return;
|