e27b27acd9d57a073fe73ccfc1062c20f0d27f86.svn-base 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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. <span v-if="record.file==null||record.file==''" style="font-size: 12px;font-style: italic;">无文件</span>
  22. <span v-else>
  23. <div style="font-size: 12px;font-style: italic; color:blue" >{{ record.file}}</div>
  24. <a-button
  25. :ghost="true"
  26. type="primary"
  27. icon="download"
  28. size="small"
  29. @click="downloadFile(record.file)">
  30. 下载
  31. </a-button>
  32. </span>
  33. </a-card>
  34. </j-modal>
  35. </template>
  36. <script>
  37. import {JeecgListMixin} from "@/mixins/JeecgListMixin";
  38. import {getFileAccessHttpUrl} from "@api/manage";
  39. export default {
  40. name: "SysAnnouncementModal",
  41. mixins: [JeecgListMixin],
  42. components: {
  43. },
  44. data () {
  45. return {
  46. title:"通知消息",
  47. record: {},
  48. labelCol: {
  49. xs: { span: 24 },
  50. sm: { span: 5 },
  51. },
  52. wrapperCol: {
  53. xs: { span: 24 },
  54. sm: { span: 16 },
  55. },
  56. visible: false,
  57. switchFullscreen: true,
  58. loading: false,
  59. bodyStyle:{
  60. padding: "0",
  61. height:(window.innerHeight*0.8)+"px",
  62. "overflow-y":"auto",
  63. },
  64. modelStyle:{
  65. width: '60%',
  66. style: { top: '20px' },
  67. fullScreen: false
  68. }
  69. }
  70. },
  71. created () {
  72. },
  73. methods: {
  74. downloadFile(text) {
  75. if (!text) {
  76. this.$message.warning("未知的文件")
  77. return;
  78. }
  79. if (text.indexOf(",") > 0) {
  80. text = text.substring(0, text.indexOf(","))
  81. }
  82. let url = getFileAccessHttpUrl(text)
  83. window.open(url);
  84. },
  85. detail (record) {
  86. this.visible = true;
  87. this.record = record;
  88. },
  89. handleCancel () {
  90. this.visible = false;
  91. },
  92. /** 切换全屏显示 */
  93. handleClickToggleFullScreen() {
  94. let mode = !this.modelStyle.fullScreen
  95. if (mode) {
  96. this.modelStyle.width = '100%'
  97. this.modelStyle.style.top = '20px'
  98. } else {
  99. this.modelStyle.width = '60%'
  100. this.modelStyle.style.top = '50px'
  101. }
  102. this.modelStyle.fullScreen = mode
  103. },
  104. toHandle(){
  105. if(this.record.openType==='url'){
  106. this.visible = false;
  107. //链接跳转
  108. this.$router.push({path: this.record.openPage})
  109. }
  110. },
  111. }
  112. }
  113. </script>
  114. <style lang="less">
  115. .announcementCustomModal{
  116. .ant-modal-header {
  117. border: none;
  118. display: inline-block;
  119. position: absolute;
  120. z-index: 1;
  121. right: 56px;
  122. padding: 0;
  123. .ant-modal-title{
  124. .custom-btn{
  125. width: 56px;
  126. height: 56px;
  127. border: none;
  128. box-shadow: none;
  129. }
  130. }
  131. }
  132. .daily-article{
  133. border-bottom: 0;
  134. }
  135. }
  136. </style>
  137. <style scoped lang="less">
  138. .daily-article {
  139. .article-button {
  140. font-size: 1.2rem !important;
  141. }
  142. .ant-card-body {
  143. padding: 18px !important;
  144. }
  145. .ant-card-head {
  146. padding: 0 1rem;
  147. }
  148. .ant-card-meta {
  149. margin-bottom: 1rem;
  150. }
  151. .article-content {
  152. p {
  153. word-wrap: break-word;
  154. word-break: break-all;
  155. text-overflow: initial;
  156. white-space: normal;
  157. font-size: .9rem !important;
  158. margin-bottom: .8rem;
  159. }
  160. }
  161. }
  162. </style>