Detail.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <template>
  2. <a-modal
  3. :title="modalTitle"
  4. :width="1200"
  5. :visible="visible"
  6. class="ant-modal2"
  7. :confirmLoading="confirmLoading"
  8. @cancel="handleCancel"
  9. >
  10. <detail-list title="" :col="1">
  11. <detail-list-item term="标题">{{ model.hname }}</detail-list-item>
  12. <detail-list-item term="简介">{{ model.shortdesc }}</detail-list-item>
  13. <detail-list-item term="简介" v-html="model.descr"></detail-list-item>
  14. </detail-list>
  15. <template slot="footer">
  16. <a-button :loading="confirmLoading" type="primary" @click="handleCancel()">返回</a-button>
  17. </template>
  18. </a-modal>
  19. </template>
  20. <script>
  21. import DetailList from '@/components/tools/DetailList'
  22. const DetailListItem = DetailList.Item
  23. export default {
  24. name: 'ArticleDetail',
  25. components: {
  26. DetailList,
  27. DetailListItem
  28. },
  29. data () {
  30. return {
  31. confirmLoading: false,
  32. mdl: {},
  33. modalTitle: null,
  34. visible: false,
  35. model: {
  36. 'id': null,
  37. 'desrc': null,
  38. 'hname': null,
  39. 'shortdesc': null
  40. }
  41. }
  42. },
  43. props: {
  44. typeMap: {
  45. type: Object,
  46. default: () => ({})
  47. }
  48. },
  49. methods: {
  50. base (record) {
  51. this.visible = true
  52. this.modalTitle = '详情'
  53. this.model = record
  54. },
  55. handleCancel () {
  56. this.visible = false
  57. this.confirmLoading = false
  58. },
  59. downTemplate (picture) {
  60. const a = document.createElement('a')
  61. console.log('picture: ' + picture)
  62. a.href = picture
  63. a.target = '_blank'
  64. a.click()
  65. }
  66. }
  67. }
  68. </script>