demo.vue
2.76 KB
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
<!--
* @Descripttion:
* @version: X3版本
* @Author: lily
* @Date: 2021-10-12 10:21:48
* @LastEditors: lily
* @LastEditTime: 2021-10-12 11:01:29
-->
<template>
<div class="wrapper">
<!-- 头部部分 -->
<div class="header">
<el-input v-model="input" placeholder="请输入内容"></el-input>
</div>
<!-- table部分 -->
<div class="main">
<div class="table-box">
<el-table class="table-list__box" ref="tableList" :data="dataList" :height="tableHeight" border stripe tooltip-effect="dark">
<el-table-column v-for="column in columns" :key="column.key" :prop="column.key" :label="column.label" :width="column.width" :min-width="150" sortable show-overflow-tooltip filter-placement="bottom"></el-table-column>
<template slot="empty" class="emptyBg">
<div class="noDataImgWrap" style="width:64px;height:41px;margin:0 auto;">
<img class="noDataImg" style="width:100%;height:100%;" src="@/assets/clientDataOverview/nodata.png" alt="" />
</div>
<!-- <div>{{ noDataText }}</div> -->
<div>暂无数据</div>
<slot name="additionalContent"></slot>
</template>
</el-table>
<!-- 分页 -->
<div class="pagination__wrapper">
<cd-pagination ref="pager" :total="pagination.total" :currPage="pagination.pageNow" :pageSize="pagination.pageSize"></cd-pagination>
</div>
</div>
</div>
</div>
</template>
<script>
const columns = [
{ key: 'accountName', label: '登录账号', width: 120 },
{ key: 'phone', label: '登录手机', width: 120 },
{ key: 'userName', label: '用户名称', width: 120 },
{ key: 'email', label: '登录邮箱', width: 210 },
{ key: 'orgNames', label: '所属组织', width: 210 },
{ key: 'roleName', label: '所属角色', width: 210 },
{ key: 'memo', label: '备注', width: 120 },
{ key: 'updateTime', label: '最后操作时间' }
]
import demo from '@/common/demo.json'
export default {
name: 'clientDemo',
components: {},
data() {
return {
input: '',
columns,
dataList: [],
tableHeight: null,
pagination: {
pageNow: 1,
pageSize: 20,
pages: 0,
total: 0
}
}
},
mounted() {
setTimeout(() => {
let height = this.$refs.tableList.$el.parentElement.clientHeight
this.tableHeight = `${height}px`
})
this.dataList = []//demo.data.rows.concat([])
}
}
</script>
<style lang="scss" scoped>
.wrapper {
background: #fff !important;
height: 100%;
display: flex;
flex-direction: column;
}
.header {
padding: 20px 8px;
background: #ccc;
}
.main {
flex: 1;
overflow: hidden;
}
.table-box {
height: 100%;
display: flex;
flex: auto;
flex-direction: column;
overflow: hidden;
}
</style>