myInsDetail.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <template>
  2. <div class="detail">
  3. <mt-header class="detail_head" fixed title="管理制度">
  4. <router-link to="" slot="left">
  5. <mt-button icon="back" v-on:click="jumpBack()"></mt-button>
  6. </router-link>
  7. </mt-header>
  8. <div class="detail_body">
  9. <div class="title">{{detail.title}}</div>
  10. <div class="indate">{{detail.indate}}</div>
  11. <div class="content">{{detail.content}}</div>
  12. <div class="file">本文附件</div>
  13. <div class="fileList">
  14. <div class="one_file" v-for="item in detail.institutionFiles" v-on:click="downLoadFile(item.url)">
  15. <div>{{item.name}}</div>
  16. <img src="../../assets/image/downLoad.png">
  17. </div>
  18. </div>
  19. </div>
  20. </div>
  21. </template>
  22. <script>
  23. export default {
  24. data() {
  25. return {
  26. id: this.$route.params.id,
  27. user: JSON.parse(sessionStorage.getItem("user")),
  28. detail: "",
  29. }
  30. },
  31. methods: {
  32. // 消息列表
  33. getDetail() {
  34. this.$indicator.open();
  35. this.http.post(this.port.my.insDetail, {
  36. 'id': this.id
  37. } ,
  38. res => {
  39. this.$indicator.close();
  40. if (res.code == "ok") {
  41. this.detail = res.data;
  42. } else {
  43. this.$toast({
  44. message: res.msg,
  45. duration: 2000
  46. });
  47. }
  48. }, error => {
  49. this.$indicator.close();
  50. this.$toast({
  51. message: error,
  52. duration: 2000
  53. });
  54. })
  55. },
  56. downLoadFile(url) {
  57. // var iframe = document.createElement('iframe');
  58. // iframe.style.display = 'none';
  59. // iframe.src = "javascript: '<script>location.href=\"" + url + "\"<\/script>'";
  60. // document.getElementsByTagName('body')[0].appendChild(iframe);
  61. var form = document.createElement('form');
  62. form.action = url;
  63. document.getElementsByTagName('body')[0].appendChild(form);
  64. form.submit();
  65. // var dtask = plus.downloader.createDownload(url);
  66. // dtask.addEventListener("statechanged", onStateChanged, false);
  67. // dtask.start();
  68. },
  69. jumpBack() {
  70. this.$router.go(-1);
  71. }
  72. },
  73. created() {
  74. this.getDetail();
  75. },
  76. mounted() {
  77. }
  78. }
  79. </script>
  80. <style scoped>
  81. body {
  82. background: #fff;
  83. }
  84. .detail {
  85. background: #fff;
  86. }
  87. .detail_head {
  88. background: #fff;
  89. color: #333;
  90. height: 0.4rem;
  91. }
  92. .detail_body {
  93. margin-top: 0.4rem;
  94. padding: 0.08rem 0.2rem;
  95. }
  96. .detail_body .title {
  97. font-weight: 500;
  98. font-size: 0.16rem;
  99. line-height: 0.25rem;
  100. }
  101. .detail_body .indate {
  102. color: #999;
  103. margin: 0.12rem 0 0.12rem 0;
  104. }
  105. .detail_body .content {
  106. color: #444;
  107. line-height: 0.2rem;
  108. /* text-indent: 2em; */
  109. padding: 0 0 0.3rem 0;
  110. border-bottom: 1px solid #ddd;
  111. }
  112. .detail_body .file {
  113. margin: 0.12rem 0 0.08rem 0;
  114. }
  115. .detail_body .one_file {
  116. padding: 0.12rem 0.04rem;
  117. }
  118. .detail_body .one_file div {
  119. display: inline-block;
  120. vertical-align: middle;
  121. width: 80%;
  122. overflow: hidden;
  123. white-space: nowrap;
  124. text-overflow: ellipsis;
  125. font-size: 0.14rem;
  126. color: #333;
  127. }
  128. .detail_body .one_file img {
  129. width: 0.15rem;
  130. float: right;
  131. vertical-align: middle;
  132. }
  133. .noList {
  134. text-align: center;
  135. padding: 1.5rem 0;
  136. }
  137. .noList img {
  138. width: 1.2rem;
  139. height: 1.2rem;
  140. }
  141. </style>