|
@@ -42,8 +42,7 @@ export default {
|
|
|
nativeList: [],
|
|
|
}),
|
|
|
async created() {
|
|
|
- this.searchSite();
|
|
|
- // await this.policyColumn();
|
|
|
+ await this.searchSite();
|
|
|
await this.defaultColumn();
|
|
|
},
|
|
|
computed: {},
|
|
@@ -65,13 +64,6 @@ export default {
|
|
|
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);
|
|
@@ -80,20 +72,15 @@ export default {
|
|
|
},
|
|
|
async searchRight({ skip = 0, limit = 10, column_id } = {}) {
|
|
|
const res = await this.policyNew({ column_id: this.leftId });
|
|
|
- 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() {
|
|
|
+ //查询默认栏目
|
|
|
+ defaultColumn() {
|
|
|
if (!(this.liebiaoList.length > 0)) return;
|
|
|
let id = _.get(this.liebiaoList[0], 'id', false);
|
|
|
if (!id) return;
|