
<template>
    <Framework header-themte="white">
<!--        showType 1和2的字段不同-->
        <div class="policy-detail" v-if="showType === 1">
<!--            <div class="policy-detail__header">-->
<!--                详情-->
<!--            </div>-->
            <div class="policy-detail__title">
                <h5>{{showInfo.data_title}}</h5>
                <span>日期：{{ showInfo.data_create.slice(1,10)  }}  &nbsp;&nbsp;&nbsp;&nbsp;   来源：{{showInfo.data_party_name}}</span>

            </div>
            <div class="policy-detail__content" v-html="showInfo.data_content">
            </div>

        </div>

        <div class="policy-detail" v-if="showType === 2">
<!--            <div class="policy-detail__header">-->
<!--                详情-->
<!--            </div>-->
            <div class="policy-detail__title">
                <h5>{{showInfo.title}}</h5>
                <span>日期：{{ showInfo.policy_date }}  &nbsp;&nbsp;&nbsp;&nbsp;   来源：{{showInfo.party_name}}</span>

            </div>
            <div class="policy-detail__content" v-html="showInfo.data_content">
            </div>

        </div>
        <div class="back">
            <router-link to="/"><img src="../../assets/images/btn_toHome.png" alt=""></router-link>
            <router-link to="/policyQuery"><img src="../../assets/images/btn_back.png" alt=""></router-link>

        </div>

    </Framework>
</template>
<script >
import Framework from '@/components/framework.vue'

export default {
  components: { Framework },
  created () {
    if (this.$route.query.type === 'policy') {
      this.getPolicyDetail(this.$route.query.data_id)
      this.showType = 2
    } else {
      this.getShowInfo(this.$route.query.data_id)
      this.showType = 1
    }
  },
  data () {
    return {
      showType: 1,
      showInfo: {
        data_create: ''
      },
      pageSize: 10,
      currentPage: 100
    }
  },
  methods: {
    async getPolicyDetail (id) {
      const params = {
        data_id: id
      }
      const { data } = await this.$http.get('api/archive/policy/getPolicyDetail.do', { params })

      this.showInfo = data
    },

    async getShowInfo (id) {
      const params = {
        data_id: id
      }
      const { data } = await this.$http.get('api/pu/info/showInfo.do', { params })
      this.showInfo = data.info
    }

  }
}
</script>
<style scoped lang="less">
.policy-detail{
    background-color: #fff;
    min-height: 840px;
    &__header {
        width: 100%;
        height: 56px;
        line-height: 56px;
        padding-left: 28px;
        font-size: 24px;
        color: #333;
        border-bottom: 1px solid #F2F2F2;
    }
    &__title{
        width: 93.33vw;
        margin: 0 auto;
        padding: 22px;
        text-align: center;
        border-bottom: 1px solid #F2F2F2;
        h5{
            font-size: 24px;
            color: #333;
            margin-bottom: 12px;

        }
        span{
            color: #999;
        }

    }
    &__content{
        width: 85.41vw;
        margin: 0 auto;
        padding: 24px 0;
        text-align: left;
        line-height: 32px;
        color: #333;

    }

}
.back{
    margin-top: 30px;
    display: flex;
    gap: 40px;
    justify-content: center;
    text-align: center;
    img{
        width: 168px

    }
}

</style>
