babbe268f6bafb69560c4b562001f98d9938cf34.svn-base 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <template>
  2. <j-modal
  3. :title="title"
  4. :width="modelStyle.width"
  5. :visible="visible"
  6. :bodyStyle ="bodyStyle"
  7. :switchFullscreen="switchFullscreen"
  8. @cancel="handleCancel"
  9. >
  10. <template slot="footer">
  11. <a-button key="back" @click="handleCancel">关闭</a-button>
  12. <a-button v-if="record.openType==='url'" type="primary" @click="toHandle">去处理</a-button>
  13. </template>
  14. <a-card class="daily-article" :loading="loading">
  15. <a-card-meta
  16. :title="record.titile"
  17. :description="'发布人:'+record.sender + ' 发布时间: ' + record.sendTime">
  18. </a-card-meta>
  19. <a-divider />
  20. <span v-html="record.msgContent" class="article-content"></span>
  21. </a-card>
  22. </j-modal>
  23. </template>
  24. <script>
  25. export default {
  26. name: "SysAnnouncementModal",
  27. components: {
  28. },
  29. data () {
  30. return {
  31. title:"通知消息",
  32. record: {},
  33. labelCol: {
  34. xs: { span: 24 },
  35. sm: { span: 5 },
  36. },
  37. wrapperCol: {
  38. xs: { span: 24 },
  39. sm: { span: 16 },
  40. },
  41. visible: false,
  42. switchFullscreen: true,
  43. loading: false,
  44. bodyStyle:{
  45. padding: "0",
  46. height:(window.innerHeight*0.8)+"px",
  47. "overflow-y":"auto",
  48. },
  49. modelStyle:{
  50. width: '60%',
  51. style: { top: '20px' },
  52. fullScreen: false
  53. }
  54. }
  55. },
  56. created () {
  57. },
  58. methods: {
  59. detail (record) {
  60. this.visible = true;
  61. this.record = record;
  62. },
  63. handleCancel () {
  64. this.visible = false;
  65. },
  66. /** 切换全屏显示 */
  67. handleClickToggleFullScreen() {
  68. let mode = !this.modelStyle.fullScreen
  69. if (mode) {
  70. this.modelStyle.width = '100%'
  71. this.modelStyle.style.top = '20px'
  72. } else {
  73. this.modelStyle.width = '60%'
  74. this.modelStyle.style.top = '50px'
  75. }
  76. this.modelStyle.fullScreen = mode
  77. },
  78. toHandle(){
  79. if(this.record.openType==='url'){
  80. this.visible = false;
  81. //链接跳转
  82. this.$router.push({path: this.record.openPage})
  83. }
  84. },
  85. }
  86. }
  87. </script>
  88. <style lang="less">
  89. .announcementCustomModal{
  90. .ant-modal-header {
  91. border: none;
  92. display: inline-block;
  93. position: absolute;
  94. z-index: 1;
  95. right: 56px;
  96. padding: 0;
  97. .ant-modal-title{
  98. .custom-btn{
  99. width: 56px;
  100. height: 56px;
  101. border: none;
  102. box-shadow: none;
  103. }
  104. }
  105. }
  106. .daily-article{
  107. border-bottom: 0;
  108. }
  109. }
  110. </style>
  111. <style scoped lang="less">
  112. .daily-article {
  113. .article-button {
  114. font-size: 1.2rem !important;
  115. }
  116. .ant-card-body {
  117. padding: 18px !important;
  118. }
  119. .ant-card-head {
  120. padding: 0 1rem;
  121. }
  122. .ant-card-meta {
  123. margin-bottom: 1rem;
  124. }
  125. .article-content {
  126. p {
  127. word-wrap: break-word;
  128. word-break: break-all;
  129. text-overflow: initial;
  130. white-space: normal;
  131. font-size: .9rem !important;
  132. margin-bottom: .8rem;
  133. }
  134. }
  135. }
  136. </style>