ZhangXianQiang
2024-03-18 faf9642920d7b981c54d55608e383e97aa022a5c
feat:成绩表格
1个文件已修改
1个文件已添加
139 ■■■■■ 已修改文件
src/views/screen/components/screen-examine/components/examine-table.vue 109 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/screen/components/screen-examine/index.vue 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/screen/components/screen-examine/components/examine-table.vue
New file
@@ -0,0 +1,109 @@
<template>
  <div class="table-container">
    <div class="table-content">
      <el-table :data="tableData" border :height="tableHeight" :max-height="tableHeight">
        <el-table-column prop="date" label="排名" align="center">
        </el-table-column>
        <el-table-column prop="name" label="名称" align="center">
        </el-table-column>
        <el-table-column prop="address" label="成绩" align="center">
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      tableHeight: 40,
      tableData: [{
        date: '2016-05-02',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-04',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1517 弄'
      }, {
        date: '2016-05-01',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1519 弄'
      },
      {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      },
      {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      },
      {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      },
      {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      },
      {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      },
      {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      },
      {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      },
      ]
    }
  },
  methods: {
    computedHeight() {
      this.$nextTick(() => {
      })
      const content = this.$refs.tabContent;
      console.log(content);
      // this.tableHeight = content.clientHeight;
    }
  },
  mounted() {
    this.$nextTick(() => {
      setTimeout(() => {
        this.computedHeight();
      },1000)
    })
  }
}
</script>
<style lang="scss" scoped>
.table-container {
  width: 100%;
  flex: 1;
  border: 1px solid red;
  position: relative;
  .table-content {
    position: absolute;
    width: 100%;
    top: 0;
    bottom: 0;
  }
}
</style>
src/views/screen/components/screen-examine/index.vue
@@ -3,7 +3,8 @@
    <wrapper-title :title="'考核成绩数据'"></wrapper-title>
    <div class="examine-content">
      <div class="examine-wrapper">
        <examine-chart></examine-chart>
        <examine-chart class="wrapper-item"></examine-chart>
        <examine-table class="wrapper-item"></examine-table>
      </div>
    </div>
  </div>
@@ -12,11 +13,13 @@
<script>
import WrapperTitle from '../wrapper-title/index';
import ExamineChart from './components/examine-chart';
import ExamineTable from './components/examine-table';
export default {
  name: 'ScreenExamine',
  components: {
    WrapperTitle,
    ExamineChart
    ExamineChart,
    ExamineTable
  }
}
@@ -29,19 +32,26 @@
  display: flex;
  flex-direction: column;
}
.examine-content {
  width: 100%;
  flex: 1;
  position: relative;
  .examine-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
  }
}
.wrapper-item {
  background: rgba(67, 102, 155, 0.3);
  border: 1px solid rgba(47, 91, 157, 0.8);
  padding: 20px 20px;
  position: relative;
  .examine-wrapper {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
  margin-bottom: 20px;
  &:last-of-type {
    margin-bottom: 0;
  }
}
</style>