|
@@ -1,13 +1,13 @@
|
|
|
<template>
|
|
|
<div id="index">
|
|
|
<el-col :span="12" class="phontoNews">
|
|
|
- <photoNews :photoNews="photoNews"> </photoNews>
|
|
|
+ <photoNews :photoNews="tpxwList"> </photoNews>
|
|
|
</el-col>
|
|
|
<el-col :span="12" class="news">
|
|
|
- <news :chuangxinList="chuangxinList" :guoneiList="guoneiList" :zhengwuList="zhengwuList" :meitiList="meitiList"></news>
|
|
|
+ <news :chuangxinList="cxjlList" :guoneiList="gndtList" :zhengwuList="zwhdList" :meitiList="mtjjList"></news>
|
|
|
</el-col>
|
|
|
<el-col :span="8" class="notice">
|
|
|
- <notice :tongzhiList="tongzhiList"></notice>
|
|
|
+ <notice :tongzhiList="tzggList"></notice>
|
|
|
</el-col>
|
|
|
<el-col :span="16" class="zhengwu">
|
|
|
<zhengwu :zhengwu="zhengwu"></zhengwu>
|
|
@@ -29,19 +29,13 @@ import zhengwu from './parts/zhengwu.vue';
|
|
|
import gongzhong from './parts/gongzhong.vue';
|
|
|
import linkInfo from './parts/linkInfo.vue';
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
+const { mapActions: mapSite } = createNamespacedHelpers('site');
|
|
|
+const { mapActions: mapLink } = createNamespacedHelpers('link');
|
|
|
+const { mapActions: mapColumn } = createNamespacedHelpers('affairsColumn');
|
|
|
+const { mapActions: mapNews } = createNamespacedHelpers('affairsNews');
|
|
|
export default {
|
|
|
name: 'index',
|
|
|
- props: {
|
|
|
- // photoNews: { type: Array, default: () => [] }, //图片新闻
|
|
|
- // chuangxinList: { type: Array, default: () => [] }, //科技政务图片旁边新闻
|
|
|
- // guoneiList: { type: Array, default: () => [] }, //科技政务图片旁边国内动态
|
|
|
- // zhengwuList: { type: Array, default: () => [] }, //科技政务图片旁边政务活动
|
|
|
- // meitiList: { type: Array, default: () => [] }, //科技政务图片旁边媒体焦距
|
|
|
- // tongzhiList: { type: Array, default: () => [] }, //通知公告
|
|
|
- // zhengwu: { type: Array, default: () => [] }, //政务公开
|
|
|
- // gongzhongList: { type: Array, default: () => [] }, //公众参与
|
|
|
- // linkList: { type: Array, default: () => [] }, //友情链接
|
|
|
- },
|
|
|
+ props: {},
|
|
|
components: { photoNews, news, notice, zhengwu, gongzhong, linkInfo },
|
|
|
data: () => {
|
|
|
return {
|
|
@@ -137,8 +131,51 @@ export default {
|
|
|
linkList: [],
|
|
|
};
|
|
|
},
|
|
|
- created() {},
|
|
|
- methods: {},
|
|
|
+ created() {
|
|
|
+ this.searchSite();
|
|
|
+ this.searchLink();
|
|
|
+ this.searchColumn();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ ...mapSite(['showInfo']),
|
|
|
+ ...mapLink({ linksList: 'query' }),
|
|
|
+ ...mapColumn({ columnList: 'query', columnInfo: 'fetch' }),
|
|
|
+ ...mapNews({ newsList: 'query' }),
|
|
|
+ // 查询站点信息
|
|
|
+ async searchSite() {
|
|
|
+ let res = await this.showInfo();
|
|
|
+ let object = JSON.parse(JSON.stringify(res.data));
|
|
|
+ if (object) {
|
|
|
+ this.$set(this, `info`, res.data);
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.errmsg ? res.errmsg : 'error');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //查询标题
|
|
|
+ async searchLink({ ...info } = {}) {
|
|
|
+ const res = await this.linksList({ ...info });
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$set(this, `linkList`, res.data);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 查询科技政务栏目
|
|
|
+ async searchColumn({ ...info } = {}) {
|
|
|
+ const res = await this.columnList({ ...info });
|
|
|
+ for (const val of res.data) {
|
|
|
+ this.tpxwSearch({ column_id: val.id, site: val.site });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 查询信息列表
|
|
|
+ async tpxwSearch({ skip = 0, limit = 10, column_id, site } = {}) {
|
|
|
+ const res = await this.newsList({ skip, limit, column_id: column_id });
|
|
|
+ for (const val of res.data) {
|
|
|
+ const result = await this.columnInfo(val.column_id);
|
|
|
+ val.column_name = result.data.name;
|
|
|
+ }
|
|
|
+ this.$set(this, `${site}List`, res.data);
|
|
|
+ console.log(res.data);
|
|
|
+ },
|
|
|
+ },
|
|
|
computed: {
|
|
|
...mapState(['user']),
|
|
|
pageTitle() {
|