FileText.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <template>
  2. <el-row>
  3. <el-row>
  4. <el-col v-for="(item, index) in dataList" :key="index" :md="6" :sm="12" :xs="12">
  5. <el-row style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
  6. <el-card class="box-card">
  7. <div slot="header" class="clearfix">
  8. <span style="left: 0;margin-bottom: 0px;color: black;">{{ item.filename }}</span>
  9. </div>
  10. <div class="text item">
  11. </div>
  12. </el-card>
  13. </el-row>
  14. </el-col>
  15. </el-row>
  16. </el-row>
  17. </template>
  18. <script>
  19. import {
  20. getImageList
  21. } from '@/api/disk'
  22. import {get} from "@/utils/request";
  23. export default {
  24. name: 'FileText',
  25. data() {
  26. return {
  27. // 屏幕宽度, 为了控制分页条的大小
  28. screenWidth: document.body.clientWidth,
  29. currentPage: 1,
  30. pageSize: 10,
  31. totalSize: 0,
  32. dataList: [],
  33. audioList: [],
  34. searchForm: {
  35. pageNumber: 1,
  36. fileType: 1004
  37. }
  38. }
  39. },
  40. created() {
  41. document.title = '我的文本'
  42. this.getData()
  43. },
  44. methods: {
  45. getData() {
  46. this.dataList = []
  47. getImageList(this.searchForm).then(resp => {
  48. if (resp.code === 0) {
  49. this.dataList = resp.data.list
  50. this.totalSize = resp.data.totalSize
  51. for (const item of this.dataList) {
  52. console.log(item)
  53. }
  54. } else {
  55. this.$notify({
  56. title: '提示',
  57. message: resp.msg,
  58. type: 'warning',
  59. duration: 3000
  60. })
  61. }
  62. }).catch(error => {
  63. this.$notify({
  64. title: '提示',
  65. message: error.message,
  66. type: 'error',
  67. duration: 3000
  68. })
  69. })
  70. },
  71. loadAll() {
  72. const item = this.dataList[0]
  73. get(item.url).then(resp => {
  74. console.log(resp)
  75. })
  76. }
  77. }
  78. }
  79. </script>
  80. <style scoped>
  81. .time {
  82. font-size: 15px;
  83. color: #999;
  84. }
  85. .bottom {
  86. margin-top: 13px;
  87. line-height: 12px;
  88. }
  89. .tit {
  90. font-weight: 700;
  91. font-size: 18px;
  92. height: 50px;
  93. overflow: hidden;
  94. text-overflow: ellipsis;
  95. display: -webkit-box;
  96. -webkit-line-clamp: 2; /*行数*/
  97. -webkit-box-orient: vertical;
  98. }
  99. .num {
  100. position: relative;
  101. font-size: 15px;
  102. padding-top: 9px;
  103. }
  104. /*处于手机屏幕时*/
  105. @media screen and (max-width: 768px) {
  106. .tit {
  107. font-weight: 600;
  108. font-size: 12px;
  109. height: 32px;
  110. }
  111. .time {
  112. font-size: 10px;
  113. color: #999;
  114. }
  115. .num {
  116. font-size: 9px;
  117. padding-top: 3px;
  118. }
  119. .bottom {
  120. margin-top: 2px;
  121. line-height: 7px;
  122. }
  123. .coverImg {
  124. height: 120px !important;
  125. }
  126. }
  127. .coverImg {
  128. width: 100%;
  129. height: 175px;
  130. display: block;
  131. }
  132. .clearfix:before,
  133. .clearfix:after {
  134. display: table;
  135. content: "";
  136. }
  137. .clearfix:after {
  138. clear: both;
  139. }
  140. .card {
  141. margin-bottom: 20px;
  142. transition: all 0.6s; /*所有属性变化在0.6秒内执行动画*/
  143. }
  144. /*.card:hover {
  145. !*鼠标放上之后元素变成1.06倍大小*!
  146. transform: scale(1.06);
  147. }*/
  148. .imgs {
  149. position: relative;
  150. }
  151. .play-icon {
  152. position: absolute;
  153. /*top: -15px;*/
  154. right: 2%;
  155. bottom: 5px;
  156. z-index: 7;
  157. width: 40px;
  158. }
  159. </style>