13404089107
2 天以前 e950c38ba82e5e6bc8b0c50c35e5dbb6a180165a
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
<template>
    <div class="table-slot">
        <template v-if="$slots.search">
            <div class="search">
                <slot name="search"></slot>
            </div>
        </template>
        <div class="table">
            <template v-if="$slots.setting">
                <div style="margin-bottom: 20px;">
                    <slot name="setting"></slot>
                </div>
            </template>
            <template v-if="$slots.table">
                <Table :data="tableData" :total="total" :height="height" :queryForm="queryForm"
                    @handleCurrentChange="handleCurrentChange" 
                    @handleSizeChange="handleSizeChange"
                    @selection-change="handleSelectionChange">
                    <slot name="table"></slot>
                </Table>
            </template>
            <template v-if="$slots.tableCustom">
                <slot name="tableCustom"></slot>
            </template>
        </div>
    </div>
</template>
 
<script>
import Table from '../Table/index.vue'
import Vue from 'vue'
export default {
    components: {
        Table,
    },
    props: {
        height: {
            type: Number,
            default: () => Vue.prototype.$baseTableHeight()
        },
        tableData: {
            type: Array,
            default: () => []
        },
        total: {
            type: Number,
            default: 0
        },
        queryForm: {
            type: Object,
            default: () => {
                return {
                    pageSize: 10,
                    pageNum: 1
                }
            }
        }
    },
    methods: {
        handleCurrentChange(page) {
            this.$emit('handleCurrentChange', page)
        },
        handleSizeChange(size) {
            this.$emit('handleSizeChange', size)
        },
        handleSelectionChange(selection) {
            this.$emit('selection-change', selection)
        }
    }
}
</script>
 
<style scoped lang="less">
.table-slot {
    height: 100%;
    display: flex;
    flex-direction: column;
}
 
.search {
    padding: 34px 30px 15px 30px;
    box-shadow: 0px 10px 19px 0px rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    border: 4px solid #FFFFFF;
    background: rgba(255, 255, 255, 0.8);
    margin-bottom: 30px;
}
 
.table {
    flex: 1;
    padding: 20px;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0px 10px 19px 0px rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    border: 4px solid #FFFFFF;
}
</style>