lookPageTable.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <!-- 设备清单的有select的表格 -->
  2. <template>
  3. <div class='look-page'>
  4. <div class='eq-list-top'>
  5. <a-input-search placeholder style='width: 192px;margin-bottom:12px;height:32px;' @search='onSearch' />
  6. </div>
  7. <el-table :data='tableData' style='width: 100%'>
  8. <el-table-column type='index' label='序号' width='80'></el-table-column>
  9. <el-table-column prop='lb' label='分类' width='160'></el-table-column>
  10. <el-table-column prop='sl' label='文件名称'></el-table-column>
  11. <el-table-column prop='unit' label='文件类型'></el-table-column>
  12. <el-table-column prop='brand' label='文件大小(M)'></el-table-column>
  13. <el-table-column prop='brand' label='操作'>
  14. <template slot-scope='{row}'>
  15. <el-button type='text' size='mini' @click='handleDown(row)'>
  16. <i class='el-icon-download'></i>下载
  17. </el-button>
  18. </template>
  19. </el-table-column>
  20. </el-table>
  21. <div class='foot'>
  22. <el-pagination
  23. background
  24. layout='prev, pager, next'
  25. :total='total/pageSize'
  26. :page-size='size'
  27. @prev-click='pageChanged'
  28. @next-click='pageChanged'
  29. @current-change='pageChanged'
  30. ></el-pagination>
  31. </div>
  32. </div>
  33. </template>
  34. <script>
  35. import { queryEquipmentList } from '@/api/equipmentList.js'
  36. export default {
  37. data() {
  38. return {
  39. pageSize: 10,
  40. tableData: [{ index: 1 }],
  41. total: 0,
  42. currentPage: 1,
  43. size: 10
  44. }
  45. },
  46. props: ['major'],
  47. methods: {
  48. onSearch() {},
  49. pageChanged(page, size) {
  50. this.currentPage = page
  51. this.size = size
  52. this.getList()
  53. },
  54. getList() {
  55. let postParams = {}
  56. let data = {
  57. page: this.currentPage,
  58. size: this.size,
  59. plazaId: this.$store.state.plazaId,
  60. major: this.major
  61. }
  62. queryEquipmentList({ data, postParams }).then(res => {
  63. console.log(res)
  64. this.tableData = res.data.data
  65. this.total = res.data.count
  66. })
  67. },
  68. handleDown() {}
  69. },
  70. mounted() {
  71. // this.getList()
  72. }
  73. }
  74. </script>
  75. <style lang="less" scoped>
  76. .look-page {
  77. .eq-list-top {
  78. display: flex;
  79. }
  80. .foot {
  81. position: absolute;
  82. height: 32px;
  83. right: 26px;
  84. bottom: 20px;
  85. }
  86. td {
  87. overflow: hidden;
  88. text-overflow: ellipsis;
  89. white-space: nowrap;
  90. }
  91. }
  92. </style>