<template>
  <div id="government">
    <government-detail
      :info="info"
      :photoNews="photoNews"
      :zhengwu="zhengwu"
      :chuangxinList="chuangxinList"
      :guoneiList="guoneiList"
      :zhengwuList="zhengwuList"
      :meitiList="meitiList"
      :tongzhiList="tongzhiList"
      :gongzhongList="gongzhongList"
      :linkList="linkList"
    ></government-detail>
  </div>
</template>

<script>
import governmentDetail from '@/components/government/government.vue';
import { createNamespacedHelpers, mapGetters } from 'vuex';
const { mapActions: mapSite } = createNamespacedHelpers('site');
const { mapActions: mapLink } = createNamespacedHelpers('link');
export default {
  name: 'government',
  props: {},
  components: {
    governmentDetail,
  },
  data: () => ({
    info: {},
    photoNews: {
      pic: require('@/assets/photoNews.jpg'),
      title: '标题',
    },
    chuangxinList: [
      {
        title: '创新吉林',
        date: '2019-03-06',
      },
      {
        title: '十条数据',
        date: '2019-03-06',
      },
    ],
    guoneiList: [
      {
        title: '国内动态',
        date: '2019-03-06',
      },
      {
        title: '十条数据',
        date: '2019-03-06',
      },
    ],
    zhengwuList: [
      {
        title: '政务活动',
        date: '2019-03-06',
      },
      {
        title: '十条数据',
        date: '2019-03-06',
      },
    ],
    meitiList: [
      {
        title: '媒体聚焦',
        date: '2019-03-06',
      },
      {
        title: '十条数据',
        date: '2019-03-06',
      },
    ],
    tongzhiList: [
      {
        title: '通知公告',
        date: '2019-03-06',
      },
      {
        title: '八条数据',
        date: '2019-03-06',
      },
    ],
    zhengwu: [
      {
        title: '高企认定',
        url: 'http://kjt.jl.gov.cn/bsfw/gxjsqyrd/',
        pic: require('@/assets/zw1.png'),
      },
      {
        title: '成果登记',
        url: 'http://kjt.jl.gov.cn/bsfw/kjcgdj/',
        pic: require('@/assets/zw2.png'),
      },
      {
        title: '合同登记',
        url: 'http://kjt.jl.gov.cn/bsfw/jshtdj/',
        pic: require('@/assets/zw3.png'),
      },
      {
        title: '计划管理',
        url: 'http://kjt.jl.gov.cn/bsfw/kjjhxmsb/',
        pic: require('@/assets/zw4.png'),
      },
      {
        title: '奖励申报',
        url: 'http://kjt.jl.gov.cn/bsfw/kjjlsb/',
        pic: require('@/assets/zw5.png'),
      },
      {
        title: '专利申请',
        url: 'http://kjt.jl.gov.cn/bsfw/zlsq/',
        pic: require('@/assets/zw6.png'),
      },
      {
        title: '相关下载',
        url: 'http://kjt.jl.gov.cn/bsfw/xzzx/',
        pic: require('@/assets/zw7.png'),
      },
      {
        title: '政务信息公开',
        url: 'http://kjt.jl.gov.cn/xxgk/',
        pic: require('@/assets/zw8.png'),
      },
    ],
    gongzhongList: [
      {
        url: 'http://kjt.jl.gov.cn/gzcy/tzxx/',
        pic: require('@/assets/gk1.png'),
        title: '厅长信箱',
      },
      {
        url: 'http://kjt.jl.gov.cn/gzcy/zxzx/',
        pic: require('@/assets/gk2.png'),
        title: '在线咨询',
      },
      {
        url: 'http://kjt.jl.gov.cn/gzcy/jdts/',
        pic: require('@/assets/gk3.png'),
        title: '监督投诉',
      },
      {
        url: 'http://kjt.jl.gov.cn/gzcy/jyxc/',
        pic: require('@/assets/gk4.png'),
        title: '建言献策',
      },
      {
        url: 'http://kjt.jl.gov.cn/gzcy/wsdc/',
        pic: require('@/assets/gk5.png'),
        title: '网上调查',
      },
      {
        title: '党政资料',
        url: 'http://139.210.167.203/free-technological-management/PersonalFiles/getPersonalFileList?pageNumber=1',
        pic: require('@/assets/gk6.png'),
      },
    ],
    linkList: [],
  }),
  created() {
    this.searchSite();
    this.searchLink();
  },
  computed: {},
  methods: {
    ...mapSite(['showInfo']),
    ...mapLink(['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.query({ ...info });
      if (this.$checkRes(res)) {
        this.$set(this, `linkList`, res.data);
      }
    },
  },
};
</script>

<style lang="scss" scoped></style>
