detAnnModal.vue 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <template>
  2. <!-- 公告详情 弹框 -->
  3. <a-modal v-model="annVisible" title="公告通知详情" @ok="handleOk" width="90%" @cancel="close">
  4. <a-row :gutter="24">
  5. <a-col :span="12">
  6. <p>
  7. 标题: <span class="annDet">{{ fatherData.title }}</span>
  8. </p>
  9. </a-col>
  10. <a-col :span="12">
  11. <p>
  12. 类型: <span class="annDet">{{ fatherData.type }}</span>
  13. </p>
  14. </a-col>
  15. </a-row>
  16. <a-row :gutter="24">
  17. <a-col :span="12">
  18. <p>
  19. 创建人: <span class="annDet"> {{ fatherData.createBy }}</span>
  20. </p>
  21. </a-col>
  22. <a-col :span="12">
  23. <p>
  24. 创建日期: <span class="annDet">{{ fatherData.createTime }}</span>
  25. </p>
  26. </a-col>
  27. </a-row>
  28. <a-row :gutter="24">
  29. <a-col :span="24">
  30. <p>详情:</p>
  31. <!-- 文本框 -->
  32. <span v-html="fatherData.content" class="valueBox" style="minHeight:120px;"></span>
  33. </a-col>
  34. </a-row>
  35. </a-modal>
  36. </template>
  37. <script>
  38. export default {
  39. data () {
  40. return {
  41. annVisible: false // 公告详情关闭
  42. }
  43. },
  44. // 接收父组件的数据
  45. props: {
  46. fatherData: {
  47. type: Object,
  48. default: null
  49. },
  50. fatherMethod: {
  51. type: Function,
  52. default: null
  53. }
  54. },
  55. methods: {
  56. // 公告详情 弹框按钮
  57. handleOk (e) {
  58. console.log(e)
  59. this.annVisible = false
  60. // this.fatherData = '' // 清空弹框 会报错
  61. this.fatherData.title = ''
  62. this.fatherData.type = ''
  63. this.fatherData.createBy = ''
  64. this.fatherData.createTime = ''
  65. this.fatherData.content = ''
  66. },
  67. close () {
  68. this.annVisible = false
  69. // this.fatherData = '' // 清空弹框 会报错
  70. this.fatherData.title = ''
  71. this.fatherData.type = ''
  72. this.fatherData.createBy = ''
  73. this.fatherData.createTime = ''
  74. this.fatherData.content = ''
  75. }
  76. }
  77. }
  78. </script>
  79. <style lang="less" scoped>
  80. //富文本内容
  81. .valueBox {
  82. width: 100%;
  83. font-weight: 700;
  84. display: block;
  85. border: 1px solid #ccc;
  86. padding: 10px;
  87. }
  88. // 整个详情弹框内容
  89. .annDet {
  90. font-weight: 700;
  91. }
  92. </style>