SingleNotification.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <template>
  2. <div class="container-fluid">
  3. <div class="flex-header">
  4. <Navbar title="消息详情" :is-go-back="true" />
  5. </div>
  6. <div class="row">
  7. <div class="col-md-12">
  8. <div class="row">
  9. <a href="#" class="list-group-item active">
  10. <span class="user-text">{{ message.publishUserName }}</span>
  11. {{ message.releaseDate }}
  12. 发布
  13. </a>
  14. <a href="#" class="list-group-item">标题:{{ message.title }}</a>
  15. <a href="#" class="list-group-item">内容:{{ message.message }}</a>
  16. <a href="#" class="list-group-item">链接:<button
  17. class="btn btn-link"
  18. @click="queryReport(message.linkUrl)"
  19. >
  20. 查看
  21. </button>
  22. </a>
  23. </div>
  24. </div>
  25. </div>
  26. <ImagePreview ref="imagePreview" />
  27. </div>
  28. </template>
  29. <script>
  30. import Common from '../common/Common.js';
  31. import AuthImage from '../widget/AuthImage.vue';
  32. import { Notify, Uuid } from 'pc-component-v3';
  33. export default {
  34. components: {
  35. AuthImage,
  36. },
  37. data: function () {
  38. this.Common = Common;
  39. return {
  40. messageId: null,
  41. message: {},
  42. className: 'com.leanwo.prodog.base.model.User',
  43. };
  44. },
  45. watch: {
  46. $route: function () {
  47. this.messageId = this.$route.params.messageId;
  48. this.getMessageById();
  49. },
  50. },
  51. mounted: function () {
  52. this.messageId = this.$route.params.messageId;
  53. this.getMessageById();
  54. },
  55. methods: {
  56. queryReport: function (linkUrl) {
  57. var _self = this;
  58. if (linkUrl != undefined && linkUrl.length > 0) {
  59. _self.$router.push(linkUrl);
  60. }
  61. },
  62. // 根据用户Id获取消息
  63. getMessageById: function (userId) {
  64. var _self = this;
  65. $.ajax({
  66. url: Common.getApiURL('messageQueueResource/queryById'),
  67. type: 'get',
  68. dataType: 'json',
  69. data: {
  70. messageId: _self.messageId,
  71. },
  72. beforeSend: function (request) {
  73. Common.addTokenToRequest(request);
  74. },
  75. success: function (data) {
  76. // data.linkUrl = Common.getRootPath() + data.linkUrl;
  77. if(data.errorCode != 0){
  78. Notify.error('提示', data.errorMessage, false);
  79. return;
  80. }
  81. _self.message = data.data;
  82. },
  83. error: function (XMLHttpRequest, textStatus, errorThrown) {
  84. Common.processException(XMLHttpRequest, textStatus, errorThrown);
  85. },
  86. });
  87. },
  88. },
  89. };
  90. </script>
  91. <style scoped>
  92. .message-body {
  93. background-color: white;
  94. padding: 10px 20px;
  95. }
  96. .user-text {
  97. font-weight: bold;
  98. }
  99. .message-time {
  100. color: #887;
  101. }
  102. .message-box {
  103. border: 1px #ccc solid;
  104. }
  105. .message-field {
  106. text-align: right;
  107. }
  108. .img-publish {
  109. width: 60px;
  110. height: 60px;
  111. border-radius: 50%;
  112. border: 1px #ffffff solid;
  113. }
  114. .title {
  115. font-size: 1.1em;
  116. font-weight: bold;
  117. }
  118. </style>