New file |
| | |
| | | <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> |
| | |
| | | <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> |
| | |
| | | <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 |
| | | } |
| | | } |
| | | |
| | |
| | | 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> |