lookPageTable.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <!-- 查看图纸-->
  2. <template>
  3. <div class='look-page'>
  4. <div class='eq-list-top'>
  5. <el-input
  6. placeholder='搜索文件名'
  7. size='small'
  8. @change='getList'
  9. clearable
  10. prefix-icon='el-icon-search'
  11. v-model='keyword'
  12. style='width:192px;margin-right:12px'
  13. ></el-input>
  14. <Select @change='getList' v-model='floor' width='180' tipPlace='top' caption='楼层 :' :selectdata='floorSelect'></Select>
  15. <!-- <Select @change='getList' v-model='fileType' width='180' tipPlace='top' caption='文件类型:' :selectdata='files'></Select> -->
  16. </div>
  17. <el-table :data='tableData' style='width: 100%' :border='true'>
  18. <el-table-column type='index' label='序号' width='60' :index='indexMethod'></el-table-column>
  19. <el-table-column prop='lb' label='分类' width='300' show-overflow-tooltip resizable>
  20. <template slot-scope='{row}'>{{row.assetnum || '--'}}</template>
  21. </el-table-column>
  22. <el-table-column prop='sl' label='文件名称' show-overflow-tooltip resizable>
  23. <template slot-scope='{row}'>{{row.assetnum || '--'}}</template>
  24. </el-table-column>
  25. <el-table-column prop='assetnum' label='文件类型' width='70' show-overflow-tooltip resizable>
  26. <template slot-scope='{row}'>{{row.assetnum || '--'}}</template>
  27. </el-table-column>
  28. <el-table-column prop='assetnum' label='上传文件名'>
  29. <template slot-scope='{row}'>{{row.assetnum || '--'}}</template>
  30. </el-table-column>
  31. <el-table-column label='操作' width='70'>
  32. <template slot-scope='{row}'>
  33. <el-button type='text' size='mini' @click='handleDown(row)'>
  34. <i class='el-icon-download'></i>预览
  35. </el-button>
  36. </template>
  37. </el-table-column>
  38. </el-table>
  39. <div class='foot'>
  40. <el-pagination
  41. background
  42. layout='prev, pager, next'
  43. :total='total'
  44. :page-size='size'
  45. @prev-click='pageChanged'
  46. @next-click='pageChanged'
  47. @current-change='pageChanged'
  48. ></el-pagination>
  49. </div>
  50. </div>
  51. </template>
  52. <script>
  53. import { queryEquipmentList } from '@/api/equipmentList.js'
  54. import { mapGetters } from 'vuex'
  55. export default {
  56. data() {
  57. return {
  58. tableData: [{ index: 1 }],
  59. total: 0,
  60. currentPage: 1,
  61. size: 11,
  62. keyword: '',
  63. floor: '',
  64. fileType: '',
  65. files: []
  66. }
  67. },
  68. props: ['major'],
  69. computed: {
  70. ...mapGetters(['floorSelect'])
  71. },
  72. methods: {
  73. //序号的方法
  74. indexMethod(index) {
  75. return (this.currentPage - 1) * this.size + index + 1
  76. },
  77. pageChanged(page, size) {
  78. this.currentPage = page
  79. this.getList()
  80. },
  81. getList() {
  82. let postParams = {}
  83. let data = {
  84. page: this.currentPage,
  85. size: this.size,
  86. plazaId: this.$store.state.plazaId,
  87. major: this.major
  88. }
  89. queryEquipmentList({ data, postParams }).then(res => {
  90. //console.log(res)
  91. this.tableData = res.data.data
  92. this.total = res.data.count
  93. })
  94. },
  95. handleDown() {}
  96. },
  97. mounted() {
  98. // this.getList()
  99. }
  100. }
  101. </script>
  102. <style lang="less" scoped>
  103. .look-page {
  104. .eq-list-top {
  105. display: flex;
  106. margin-bottom: 12px;
  107. }
  108. td {
  109. overflow: hidden;
  110. text-overflow: ellipsis;
  111. white-space: nowrap;
  112. }
  113. .foot {
  114. height: 32px;
  115. display: flex;
  116. justify-content: flex-end;
  117. margin-top: 28px;
  118. }
  119. }
  120. </style>