|
@@ -1,11 +1,24 @@
|
|
|
<template>
|
|
|
<div id="shuju">
|
|
|
- <shuju-detail :info="info" :imageList="imageList" :gonggaoList="gonggaoList" :shangbaoList="shangbaoList" :tongzhiList="tongzhiList"></shuju-detail>
|
|
|
+ <shuju-detail
|
|
|
+ :info="info"
|
|
|
+ :liebiaoList="liebiaoList"
|
|
|
+ :imageList="imageList"
|
|
|
+ :gonggaoList="tzggList"
|
|
|
+ :shangbaoList="shangbaoList"
|
|
|
+ :tongzhiList="tzggList"
|
|
|
+ ></shuju-detail>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import shujuDetail from '@/components/shuju/shuju.vue';
|
|
|
+import { createNamespacedHelpers, mapGetters } from 'vuex';
|
|
|
+import _ from 'loadsh';
|
|
|
+const { mapActions: mapSite } = createNamespacedHelpers('site');
|
|
|
+const { mapActions: mappolicyColumn } = createNamespacedHelpers('recordColumn');
|
|
|
+const { mapActions: mapAffairsColumn } = createNamespacedHelpers('affairsColumn');
|
|
|
+const { mapActions: mapAffairsNews } = createNamespacedHelpers('affairsNews');
|
|
|
export default {
|
|
|
name: 'shuju',
|
|
|
props: {},
|
|
@@ -13,16 +26,10 @@ export default {
|
|
|
shujuDetail,
|
|
|
},
|
|
|
data: () => ({
|
|
|
- info: {
|
|
|
- logo: require('@/assets/logo.png'),
|
|
|
- banquan: '版权所有:吉林省计算中心',
|
|
|
- jishu: '技术支持:长春市福瑞科技有限公司',
|
|
|
- youbian: '邮编:130000',
|
|
|
- chuanzhen: '传真:239823982',
|
|
|
- address: '地址:吉林省长春市朝阳区前进大街1244号',
|
|
|
- phone: '电话:0431-1234567',
|
|
|
- email: '邮箱:123456@163.com',
|
|
|
- },
|
|
|
+ info: {},
|
|
|
+ // 分类导航
|
|
|
+ liebiaoList: {},
|
|
|
+ // 数据展示
|
|
|
imageList: [
|
|
|
{
|
|
|
pic: require('@/assets/biao1.png'),
|
|
@@ -30,7 +37,6 @@ export default {
|
|
|
{
|
|
|
pic: require('@/assets/biao2.png'),
|
|
|
},
|
|
|
-
|
|
|
{
|
|
|
pic: require('@/assets/biao3.png'),
|
|
|
},
|
|
@@ -41,15 +47,9 @@ export default {
|
|
|
pic: require('@/assets/biao5.png'),
|
|
|
},
|
|
|
],
|
|
|
-
|
|
|
- gonggaoList: [
|
|
|
- {
|
|
|
- title: '标题',
|
|
|
- },
|
|
|
- {
|
|
|
- title: '六条数据',
|
|
|
- },
|
|
|
- ],
|
|
|
+ // 通知公告
|
|
|
+ tzggList: [],
|
|
|
+ // 上报通知
|
|
|
shangbaoList: [
|
|
|
{
|
|
|
title: '标题',
|
|
@@ -60,20 +60,52 @@ export default {
|
|
|
date: '2019-01-02',
|
|
|
},
|
|
|
],
|
|
|
- tongzhiList: [
|
|
|
- {
|
|
|
- title: '标题',
|
|
|
- date: '2019-01-02',
|
|
|
- },
|
|
|
- {
|
|
|
- title: '十条数据',
|
|
|
- date: '2019-01-02',
|
|
|
- },
|
|
|
- ],
|
|
|
}),
|
|
|
- created() {},
|
|
|
+ async created() {
|
|
|
+ this.searchSite();
|
|
|
+ await this.policyColumn();
|
|
|
+ await this.affairsColumn();
|
|
|
+ },
|
|
|
computed: {},
|
|
|
- methods: {},
|
|
|
+ methods: {
|
|
|
+ ...mapSite(['showInfo']),
|
|
|
+ ...mappolicyColumn({ policyColumns: 'query', policyfetch: 'fetch' }),
|
|
|
+ ...mapAffairsColumn({ affairsColumns: 'query', affairsInfo: 'fetch' }),
|
|
|
+ ...mapAffairsNews({ affairsList: '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 policyColumn({ ...info } = {}) {
|
|
|
+ const res = await this.policyColumns({ ...info });
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$set(this, `liebiaoList`, res.data);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 查询科技政务栏目
|
|
|
+ async affairsColumn({ ...info } = {}) {
|
|
|
+ const res = await this.affairsColumns({ ...info });
|
|
|
+ for (const val of res.data) {
|
|
|
+ this.kjzwSearch({ column_id: val.id, site: val.site });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async kjzwSearch({ skip = 0, limit = 10, column_id, site } = {}) {
|
|
|
+ console.log(column_id, site);
|
|
|
+ const res = await this.affairsList({ skip, limit, column_id: column_id });
|
|
|
+ for (const val of res.data) {
|
|
|
+ const result = await this.affairsInfo(val.column_id);
|
|
|
+ val.column_name = result.data.name;
|
|
|
+ }
|
|
|
+ this.$set(this, `${site}List`, res.data);
|
|
|
+ console.log(res.data);
|
|
|
+ },
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|
|
|
|