龚焕茏
2024-08-21 92b92d9801f45df8e5b56f062e6d459fee4aeac5
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
<template>
  <div class="data-table-container">
 
    <el-card class="data-card" :body-style="{ height: '100%' }">
      <div class="card-content">
        <div class="title-container">
          <h1>考核报表</h1>
          <el-select v-model="category" placeholder="请选择" @change="calculate(category)" style="width: 150px;">
            <el-option label="视频" value="1" />
            <el-option label="车辆" value="2" />
            <el-option label="人脸" value="3" />
          </el-select>
          <div class="more-button" @click="$router.push({ path: '/check/result' })">
            <span>更多</span>
            <i class="el-icon-arrow-right"></i>
          </div>
        </div>
        <el-table :data="tableData" style="width: 100%" height="350">
          <el-table-column type="index" label="排名" align="center" />
          <el-table-column prop="deptName" label="区域" align="center" show-overflow-tooltip />
          <el-table-column prop="score" label="分数" align="center" />
        </el-table>
      </div>
    </el-card>
  </div>
</template>
 
<script>
import { calculate } from "@/api/platform/home";
export default {
  name: 'DataRank',
 
  data() {
    return {
      category: "1",
      tableData: []
    }
  },
  mounted() {
    this.calculate(this.category);
  },
  methods: {
    calculate(category) {
      calculate(category).then(res => {
        this.tableData = res.data;
      })
    }
  }
}
</script>
 
<style lang="scss" scoped>
.data-table-container {
  height: 450px;
  margin-bottom: 20px;
 
  .data-card {
    height: 100%;
 
    .card-content {
      width: 100%;
      height: 100%;
      display: flex;
      flex-direction: column;
    }
  }
}
 
.title-container {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
 
  .more-button {
    cursor: pointer;
    font-size: 16px;
    padding: 0 10px;
  }
}
 
.table-container {
  position: relative;
  flex: 1;
 
  .table-content {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    overflow-y: scroll;
  }
}
 
.data-table {
  width: 100%;
}
</style>