load.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <template>
  2. <div class="load">
  3. <toptip :currTitle="currTitle"></toptip>
  4. <template>
  5. <el-table :data="newList" style="width: 100%">
  6. <el-table-column>
  7. <template slot-scope="scope">
  8. <div @mouseleave="loadHiden()" @mouseover="loadShow(scope.row.in)">
  9. <i class="el-icon-caret-right"></i>
  10. <span
  11. style="margin-left: 10px; font-size: 16px; width: 40%"
  12. class="title"
  13. @click="goto(scope.row.path)"
  14. >{{ scope.row.name }}</span
  15. >
  16. <a class="loader" :href="scope.row.loadPath" :download="scope.row.loadTitle">
  17. <span v-show="scope.row.in === current">下载</span>
  18. </a>
  19. </div>
  20. </template>
  21. </el-table-column>
  22. </el-table>
  23. </template>
  24. <div class="page-box">
  25. <el-pagination
  26. background
  27. layout="prev, pager, next"
  28. :total="count"
  29. prev-text="上一页"
  30. next-text="下一页"
  31. >
  32. </el-pagination>
  33. </div>
  34. </div>
  35. </template>
  36. <script>
  37. import toptip from "../../components/toptip";
  38. export default {
  39. metaInfo: {
  40. title: "申请表下载",
  41. },
  42. data() {
  43. return {
  44. currTitle: "申请表下载",
  45. newList: [
  46. {
  47. name: "单位会员入会申请表",
  48. in: 1,
  49. path: "dwload",
  50. loadPath: 'http://ca.liuniu946.com/uploads/20201223/93058675c2c0747769c550aacaf924e7.jpg',
  51. loadTitle: '单位会员入会申请表.jpg'
  52. },
  53. {
  54. name: "个人会员入会申请表",
  55. in: 2,
  56. path: "grload",
  57. loadPath: 'http://ca.liuniu946.com/uploads/20201223/6a30c709cbe3cb994cdf3993c0062570.jpg',
  58. loadTitle: '个人会员入会申请表.jpg'
  59. },
  60. ],
  61. isShow: false,
  62. current: 0,
  63. };
  64. },
  65. components: {
  66. toptip,
  67. },
  68. computed: {
  69. count() {
  70. return this.newList.length;
  71. },
  72. },
  73. methods: {
  74. loadShow(index) {
  75. this.current = index;
  76. },
  77. loadHiden() {
  78. this.current = 0;
  79. },
  80. goto(path) {
  81. console.log(path);
  82. this.$router.push("/committee/" + path);
  83. },
  84. down(data) {
  85. console.log(data);
  86. },
  87. },
  88. };
  89. </script>
  90. <style lang="scss" scoped>
  91. .page-box {
  92. margin-top: 40px;
  93. width: 858px;
  94. display: flex;
  95. justify-content: center;
  96. cursor: pointer;
  97. }
  98. .title {
  99. cursor: pointer;
  100. }
  101. .loader {
  102. cursor: pointer;
  103. background: url("../../assets/load.png") no-repeat;
  104. float: right;
  105. width: 45px;
  106. height: 25px;
  107. color: #fff;
  108. text-align: center;
  109. line-height: 25px;
  110. span {
  111. display: inline-block;
  112. background-color: red;
  113. width: 45px;
  114. }
  115. }
  116. </style>