|
@@ -39,6 +39,7 @@
|
|
|
import top from './parts/top.vue';
|
|
|
import list from './parts/list.vue';
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
+const { mapActions: news } = createNamespacedHelpers('news');
|
|
|
export default {
|
|
|
name: 'index',
|
|
|
props: {},
|
|
@@ -116,10 +117,41 @@ export default {
|
|
|
release_time: '2021-01-16',
|
|
|
},
|
|
|
],
|
|
|
+ column: [
|
|
|
+ { name: '政务动态', site: 'one', limit: 11 },
|
|
|
+ { name: '通知通告', site: 'two', limit: 11 },
|
|
|
+ { name: '科技新闻', site: 'thr', limit: 4 },
|
|
|
+ { name: '媒体聚焦', site: 'four', limit: 11 },
|
|
|
+ { name: '信息公开', site: 'five', limit: 12 },
|
|
|
+ ],
|
|
|
};
|
|
|
},
|
|
|
- created() {},
|
|
|
- methods: {},
|
|
|
+ async created() {
|
|
|
+ await this.search();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ ...news(['query']),
|
|
|
+ async search({ skip = 0, limit = 10, ...info } = {}) {
|
|
|
+ for (const val of this.column) {
|
|
|
+ if (val.name == '政务动态') {
|
|
|
+ let res = await this.query({ skip, limit: val.limit, column_name: val.name, ...info });
|
|
|
+ if (this.$checkRes(res)) this.$set(this, `${val.site}List`, res.data);
|
|
|
+ } else if (val.name == '通知通告') {
|
|
|
+ let res = await this.query({ skip, limit: val.limit, column_name: val.name, ...info });
|
|
|
+ if (this.$checkRes(res)) this.$set(this, `${val.site}List`, res.data);
|
|
|
+ } else if (val.name == '科技新闻') {
|
|
|
+ let res = await this.query({ skip, limit: val.limit, column_name: val.name, ...info });
|
|
|
+ if (this.$checkRes(res)) this.$set(this, `${val.site}List`, res.data);
|
|
|
+ } else if (val.name == '媒体聚焦') {
|
|
|
+ let res = await this.query({ skip, limit: val.limit, column_name: val.name, ...info });
|
|
|
+ if (this.$checkRes(res)) this.$set(this, `${val.site}List`, res.data);
|
|
|
+ } else if (val.name == '信息公开') {
|
|
|
+ let res = await this.query({ skip, limit: val.limit, column_name: val.name, ...info });
|
|
|
+ if (this.$checkRes(res)) this.$set(this, `${val.site}List`, res.data);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
computed: {
|
|
|
...mapState(['user']),
|
|
|
},
|