2
3

document.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <template>
  2. <el-card style="min-height: calc(100vh - 92px);">
  3. <div slot="header" style="height: 20px;">
  4. <span style="float: left;">
  5. <i class="icon icon-table2"></i>
  6. </span>
  7. <el-breadcrumb class="heading" style="float: left; margin-left: 5px">
  8. <el-breadcrumb-item :to="{ path: '/' }">平台首页</el-breadcrumb-item>
  9. <el-breadcrumb-item>资料下载</el-breadcrumb-item>
  10. </el-breadcrumb>
  11. </div>
  12. <div style="background-color: white; width: 60%; margin: 0 auto; ">
  13. <el-table :data="fileList"
  14. stripe
  15. highlight-current-row
  16. size="mini">
  17. <el-table-column prop="Name"
  18. align="center"
  19. label="文件资料">
  20. <template slot-scope="scope">
  21. <el-link :href="getDownloadFile(scope.row.FileURL)"
  22. target="_blank"
  23. type="primary">{{ scope.row.Name }}</el-link>
  24. </template>
  25. </el-table-column>
  26. <el-table-column prop="CreateOn"
  27. label="发布时间"
  28. align="center"
  29. width="141">
  30. <template slot-scope="scope">{{ jsTImeHandle(scope.row.CreateOn+'') }}</template>
  31. </el-table-column>
  32. <el-table-column width="80">
  33. <template slot-scope="scope"><span style="font-size: 15px; color: #f13f40">{{strNew(scope.row.CreateOn+'') }}</span></template>
  34. </el-table-column>
  35. </el-table>
  36. </div>
  37. </el-card>
  38. </template>
  39. <script>
  40. export default {
  41. name: 'notice',
  42. data () {
  43. return {
  44. fileList: [] // 文档列表
  45. }
  46. },
  47. created () {
  48. this.initFileListData()
  49. },
  50. methods: {
  51. // 获取文件列表
  52. initFileListData () {
  53. let _this = this
  54. // 传递列名
  55. const params = {
  56. colName: 'DocTab',
  57. RangeType: '1,3'
  58. }
  59. _this.$axios
  60. .get('/document/getdocumentnameandtime', { params })
  61. .then(function (response) {
  62. _this.fileList = response.data
  63. })
  64. .catch(function (error) {
  65. console.log(error)
  66. })
  67. },
  68. getDownloadFile (val) {
  69. let urlArr = val.split('|')
  70. let retUrl = urlArr[0]
  71. // 内网服务器专用
  72. if (process.client && retUrl.indexOf('/upfile') === 0) {
  73. const myDomain = window.location.host
  74. retUrl = myDomain + '/' + retUrl
  75. }
  76. return 'http://' + retUrl
  77. },
  78. // 格式化时间
  79. jsTImeHandle (val) {
  80. if (val === '') {
  81. return '----'
  82. } else if (val === '0001-01-01T08:00:00+08:00') {
  83. return '----'
  84. } else if (val === '5000-01-01T23:59:59+08:00') {
  85. return '永久'
  86. } else {
  87. val = val.replace('T', ' ')
  88. return val.substring(0, 10)
  89. }
  90. },
  91. strNew (val) {
  92. try {
  93. let b = this.jsTImeHandle(val).split('-')
  94. let date = new Date(b[0], b[1], b[2])
  95. let newDate = new Date()
  96. if ((newDate - date) / (1000 * 60 * 60 * 24) < 30) {
  97. return '新'
  98. } else {
  99. return ''
  100. }
  101. } catch (e) {
  102. return ''
  103. }
  104. }
  105. }
  106. }
  107. </script>
  108. <style lang="scss">
  109. .time {
  110. font-size: 13px;
  111. color: #999;
  112. }
  113. .bottom {
  114. margin-top: 13px;
  115. line-height: 12px;
  116. }
  117. .button {
  118. padding: 0;
  119. float: right;
  120. }
  121. .image {
  122. width: 100%;
  123. display: block;
  124. }
  125. .clearfix:before,
  126. .clearfix:after {
  127. display: table;
  128. content: "";
  129. }
  130. .clearfix:after {
  131. clear: both
  132. }
  133. .el-pagination {
  134. margin: 1rem 0 2rem;
  135. text-align: right;
  136. }
  137. .plab {
  138. font-size: 13px;
  139. color: #999;
  140. }
  141. .triggerone {
  142. font-size: 13px;
  143. margin-left: 80px;
  144. }
  145. .plab {
  146. font-size: 13px;
  147. color: #999;
  148. }
  149. .docdelete .el-radio {
  150. padding: 8px 15px 0 0;
  151. margin-left: -2px;
  152. }
  153. </style>