123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- <template>
- <div class="StandardTable">
- <Page
- v-if="showPage"
- class="page"
- :total="total"
- show-total
- show-sizer
- show-elevator
- transfer
- :page-size="pageSize"
- :current="currentPage"
- :page-size-opts="pageSizeOpts"
- v-on="standardTableEvent"
- />
- <div
- class="table"
- v-if="showTable"
- >
- <Table
- ref="table"
- class="table"
- :total="total"
- :columns="columns"
- :height = true
- :data="data"
- :border="border"
- highlight-row
- v-on="standardTableEvent"
- >
- </Table>
- </div>
- </div>
- </template>
- <script>
- export default {
- name:'StandardTable',
- props:{
- //事件回调
- standardTableEvent:{
- type:Object,
- default() {
- return {}
- }
- },
- //分页属性
- showPage:{ //控制分页是否展示
- type:Boolean,
- default:true
- },
- total:{
- type:Number,
- default:0
- },
- currentPage:{
- type:Number,
- default:1
- },
- pageSize:{
- type:Number,
- default:10
- },
- pageSizeOpts:{
- type:Array,
- default () {
- return [10,20,30,40]
- }
- },
- //表格属性
- showTable:{ //控制表格是否展示
- type:Boolean,
- default:true
- },
- columns:{
- type:Array,
- default() {
- return [];
- }
- },
- data:{
- type:Array,
- default() {
- return [];
- }
- },
- border:{
- type: Boolean,
- default: false
- }
- },
- watch:{
- data () {
- this.$refs.table.$el.getElementsByClassName('burgeon-table-body')[0].scrollTop = 0
- }
- },
- methods:{
- }
- }
- </script>
- <style lang="scss" scoped>
- .StandardTable{
- display: flex;
- overflow: hidden;
- flex-direction: column;
- .page{
- margin-bottom: 8px;
- }
-
- .table{
- flex: 1;
- overflow: hidden;
- position: relative;
- .noData{
- position:absolute;
- height: 200px;
- top: 50%;
- left: 50%;
- margin-top: -90px;
- margin-left: -80px;
- }
- }
- }
- </style>
|