<template>
  <a-modal
    :title="modalTitle"
    :width="1200"
    :visible="visible"
    class="ant-modal2"
    :confirmLoading="confirmLoading"
    @cancel="handleCancel"
  >
    <detail-list title="" :col="1">
      <detail-list-item term="标题">{{ model.hname }}</detail-list-item>
      <detail-list-item term="简介">{{ model.shortdesc }}</detail-list-item>
      <detail-list-item term="简介" v-html="model.descr"></detail-list-item>
    </detail-list>

    <template slot="footer">
      <a-button :loading="confirmLoading" type="primary" @click="handleCancel()">返回</a-button>
    </template>
  </a-modal>
</template>

<script>
import DetailList from '@/components/tools/DetailList'
const DetailListItem = DetailList.Item

export default {
  name: 'ArticleDetail',
  components: {
    DetailList,
    DetailListItem
  },
  data () {
    return {
      confirmLoading: false,
      mdl: {},
      modalTitle: null,
      visible: false,
      model: {
        'id': null,
        'desrc': null,
        'hname': null,
        'shortdesc': null
      }
    }
  },
  props: {
    typeMap: {
      type: Object,
      default: () => ({})
    }
  },
  methods: {
    base (record) {
      this.visible = true
      this.modalTitle = '详情'
      this.model = record
    },
    handleCancel () {
      this.visible = false
      this.confirmLoading = false
    },
    downTemplate (picture) {
      const a = document.createElement('a')
      console.log('picture: ' + picture)
      a.href = picture
      a.target = '_blank'
      a.click()
    }

  }
}
</script>
