room3.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <template>
  2. <div class='compute-item'>
  3. <div ref='tableBox3' class='compute-table'>
  4. <el-table
  5. :border='true'
  6. @row-click='innerTable'
  7. v-loading='loading'
  8. :max-height='tableMaxHeight'
  9. :data='table3'
  10. style='width: 100%'
  11. :header-cell-style='{background:"rgba(245,246,247,1)",fontFamily:"MicrosoftYaHei",color:"rgba(100,108,115,1)",lineHeight:"16px",fontSize:"12px"}'
  12. >
  13. <el-table-column type='index' label='序号' width='60' :index='indexMethod'></el-table-column>
  14. <el-table-column prop :show-overflow-tooltip='true' label='设备简称' resizable min-width='300'>
  15. <template slot-scope='{row}'>{{row.type_name||'--'}}</template>
  16. </el-table-column>
  17. <el-table-column prop label='数量' :show-overflow-tooltip='true' width='60'>
  18. <template slot-scope='{row}'>{{row.sl||'--'}}</template>
  19. </el-table-column>
  20. <el-table-column prop label='品牌' :show-overflow-tooltip='true' min-width='300'>
  21. <template slot-scope='{row}'>{{row.brand||'--'}}</template>
  22. </el-table-column>
  23. <el-table-column prop label='型号' :show-overflow-tooltip='true' min-width='300'>
  24. <template slot-scope='{row}'>{{row.sbxh||'--'}}</template>
  25. </el-table-column>
  26. <el-table-column prop label='楼层' :show-overflow-tooltip='true' width='60'>
  27. <template slot-scope='{row}'>{{row.floorcode||'--'}}</template>
  28. </el-table-column>
  29. <el-table-column prop :show-overflow-tooltip='true' label='生产厂商' min-width='300'>
  30. <template slot-scope='{row}'>{{row.manufacturer||'--'}}</template>
  31. </el-table-column>
  32. </el-table>
  33. </div>
  34. <div class='foot'>
  35. <el-pagination
  36. background
  37. layout='prev, pager, next'
  38. :total='total'
  39. :page-size='size'
  40. @prev-click='pageChanged'
  41. @next-click='pageChanged'
  42. @current-change='pageChanged'
  43. ></el-pagination>
  44. </div>
  45. <el-dialog width='90%' :title='`${systemName}-${row.type_name}`' :visible.sync='innerVisible' append-to-body>
  46. <detail v-if='row' :row='row' :location='location' :floorChange='floorChange'></detail>
  47. </el-dialog>
  48. </div>
  49. </template>
  50. <script>
  51. // import Select from '@/components/Select/Select.vue'
  52. import { Select } from 'meri-design'
  53. import Detail from './detail'
  54. export default {
  55. props: ['table3', 'total', 'page', 'size', 'loading', 'floorChange', 'systemName', 'location'],
  56. data() {
  57. return {
  58. innerVisible: false,
  59. row: {},
  60. tableMaxHeight: 0,
  61. }
  62. },
  63. components: { Select, Detail },
  64. methods: {
  65. indexMethod(index) {
  66. return (this.page - 1) * this.size + index + 1
  67. },
  68. modalClose() {
  69. this.innerVisible = false
  70. },
  71. pageChanged(page) {
  72. this.$emit('Index2Emit', page)
  73. },
  74. innerTable(row) {
  75. this.row = row
  76. this.innerVisible = true
  77. },
  78. computedHeight() {
  79. this.$nextTick(() => {
  80. // 页面渲染完成后的回调
  81. this.tableMaxHeight = this.$refs.tableBox3.offsetHeight
  82. })
  83. },
  84. },
  85. updated() {
  86. this.$nextTick(() => {
  87. // 页面渲染完成后的回调
  88. this.tableMaxHeight = this.$refs.tableBox3.offsetHeight
  89. })
  90. },
  91. }
  92. </script>
  93. <style lang="less" scoped>
  94. </style>
  95. <style lang="less">
  96. .compute-item {
  97. .foot {
  98. height: 32px;
  99. display: flex;
  100. justify-content: flex-end;
  101. margin-top: 28px;
  102. }
  103. .el-dialog {
  104. height: 95% !important;
  105. margin-top: 50px;
  106. }
  107. /deep/.el-table td {
  108. cursor: pointer;
  109. }
  110. }
  111. </style>