seTable.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <div>
  3. <el-table ref="initList" :data="data" height="190" v-loading="loading">
  4. <template slot="empty">
  5. <span>{{text}}</span>
  6. </template>
  7. <el-table-column label="区域名称" prop="n1" show-overflow-tooltip min-width="33%" >
  8. <template slot-scope="scope">
  9. {{scope.row.n1 ? scope.row.n1 : "-"}}
  10. </template>
  11. </el-table-column>
  12. <el-table-column label="出租单位" prop="n2" show-overflow-tooltip min-width="33%" >
  13. <template slot-scope="scope">
  14. {{scope.row.n2 ? scope.row.n2 : "-"}}
  15. </template>
  16. </el-table-column>
  17. <el-table-column label="企业权限" prop="n3" show-overflow-tooltip min-width="34%" >
  18. <template slot-scope="scope">
  19. {{scope.row.n3 ? scope.row.n3 + '人' : "-"}}
  20. </template>
  21. </el-table-column>
  22. </el-table>
  23. </div>
  24. </template>
  25. <script>
  26. import axios from 'axios'
  27. export default {
  28. props: ["resData"],
  29. data() {
  30. return {
  31. text:"",
  32. loading:true,
  33. data:[]
  34. };
  35. },
  36. watch: {
  37. resData(val,old){
  38. this.data = val
  39. if(this.data.length>0){
  40. this.loading = false
  41. this.data = val
  42. }else{
  43. this.loading = false
  44. this.text = "暂无数据"
  45. }
  46. }
  47. },
  48. created(){
  49. // this.selectChange()
  50. },
  51. // watch: {
  52. // select: {
  53. // handler (n, o) {
  54. // this.selectChange()
  55. // },
  56. // deep: true // 深度监听父组件传过来对象变化
  57. // }
  58. // },
  59. mounted() {},
  60. methods: {
  61. initDataSBSS(){
  62. this.select2 = true
  63. this.select1 = false
  64. this.videoSelect = []
  65. },
  66. //数据滚动
  67. dataScrolling:function(){
  68. let top=this.$refs.initList.bodyWrapper;
  69. this.table_interval=setInterval(() => {
  70. top.scrollTop+=1;
  71. if(top.clientHeight+top.scrollTop==top.scrollHeight){
  72. top.scrollTop=0;
  73. }
  74. }, 100);
  75. },
  76. //鼠标进入,停止滚动
  77. mouseEnter:function(){
  78. // clearInterval(this.table_interval);
  79. // this.table_interval=null;
  80. },
  81. //鼠标离开,开始滚动
  82. mouseLeave:function(){
  83. // this.dataScrolling();
  84. },
  85. //点击行
  86. clickData(row){
  87. if(this.select1 == "1"){
  88. this.$emit("videoClick", row);
  89. }
  90. },
  91. // cellStyle (row, column, rowIndex, columnIndex) {
  92. // //列的label的名称
  93. // if (row.column.label === "告警" || row.column.label === "离线") {
  94. // return 'color:#2280D9' //修改的样式
  95. // }
  96. // },
  97. },
  98. };
  99. </script>
  100. <style lang="scss" scoped>
  101. @import '@/assets/styles/common.scss';
  102. ::v-deep {
  103. .el-table__body-wrapper::-webkit-scrollbar {
  104. /*width: 0;宽度为0隐藏*/
  105. width: 4px;
  106. }
  107. .el-table__body-wrapper::-webkit-scrollbar-thumb {
  108. border-radius: 6px;
  109. height: 50px;
  110. background: $white;//滚动条颜色
  111. }
  112. .el-table__body-wrapper::-webkit-scrollbar-track {
  113. box-shadow: inset 0 0 5px rgba(35,40,49,1);
  114. border-radius: 6px;
  115. background: $modularBackGround;//滚动条背景色
  116. }
  117. .el-table th > .cell {
  118. // font-size: 12px;
  119. }
  120. tr .cell{
  121. padding-left: 20px !important;
  122. }
  123. }
  124. </style>