fuliqi
2024-03-26 d67d79c396bd29ff9b8b17322928ae8a8325156b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
<template>
  <div class="table-container">
    <div class="table-content" ref="tabContent">
      <el-table :data="tableData" border :height="tableHeight" :max-height="tableHeight" class="rank-table">
        <el-table-column prop="name" label="地区" align="center" width="100">
        </el-table-column>
        <el-table-column prop="data1" label="人脸设备总数" align="center">
        </el-table-column>
        <el-table-column prop="data2" label="车辆设备总数" align="center">
        </el-table-column>
        <el-table-column prop="data3" label="视频设备总数" align="center">
        </el-table-column>
      </el-table>
    </div>
 
  </div>
</template>
 
<script>
export default {
  data() {
    return {
      tableHeight: 40,
      tableData: [
        {
          name: '富顺县',
          data1: 1123,
          data2: 1123,
          data3: 1123
        },
        {
          name: '荣县',
          data1: 1123,
          data2: 1123,
          data3: 1123
        },
        {
          name: '高新区',
          data1: 1123,
          data2: 1123,
          data3: 1123
        },
        {
          name: '自流井区',
          data1: 1123,
          data2: 1123,
          data3: 1123
        },
        {
          name: '贡井区',
          data1: 1123,
          data2: 1123,
          data3: 1123
        },
        {
          name: '大安区',
          data1: 1123,
          data2: 1123,
          data3: 1123
        },
        {
          name: '沿滩区',
          data1: 1123,
          data2: 1123,
          data3: 1123
        },
      ]
    }
  },
  methods: {
    computedHeight() {
      this.$nextTick(() => {
        setTimeout(() => {
          const content = this.$refs.tabContent;
          this.tableHeight = content.offsetHeight;
        })
      })
    }
  },
  mounted() {
    this.computedHeight();
  }
}
</script>
 
<style lang="scss" scoped>
.table-container {
  width: 100%;
  // flex: 1;
  height: 355px;
  position: relative;
  background: rgba(67, 102, 155, 0.3);
  border: 1px solid rgba(47, 91, 157, 0.8);
 
  .table-content {
    position: absolute;
    width: 100%;
    top: 0;
    bottom: 0;
  }
}
 
 
 
.rank-table {
  background-color: transparent !important;
  color: #fff !important;
 
  //滚动条的背景色
  ::-webkit-scrollbar-track {
    background-color: transparent;
  }
}
 
::v-deep .el-table tr {
  background-color: transparent !important;
}
 
::v-deep .el-table .el-table__header-wrapper th,
.el-table .el-table__fixed-header-wrapper th {
  background-color: transparent !important;
 
}
 
::v-deep .el-table--group,
.el-table--border {
  border: 0;
}
 
::v-deep .el-table th.el-table__cell.is-leaf,
.el-table td.el-table__cell {
  border-color: #56739e99 !important;
}
 
::v-deep .el-table--border .el-table__cell {
  border-color: #56739e99 !important;
}
 
::v-deep .el-table th.el-table__cell>.cell {
  color: #447ED6;
}
 
::v-deep .el-scrollbar__bar.is-vertical {
  display: none !important;
}
 
::v-deep .el-table::before,
.el-table--group::after,
.el-table--border::after {
  background-color: transparent !important;
}
 
::v-deep .el-table--enable-row-hover .el-table__body tr:hover>td.el-table__cell {
  background-color: #447ed648;
}
</style>