zhaoxiaoqiang1
2026-01-04 f1d30d03186c79ca2cbcfe60d6d2ce7d73fba97b
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<!--
 * @Author: your name
 * @Date: 2019-10-21 15:40:58
 * @LastEditTime: 2019-10-28 15:09:27
 * @LastEditors: your name
 * @Description: In User Settings Edit
 * @FilePath: \cts-web\src\components\Pagination\index.vue
 -->
<template>
  <div :class="{'hidden':hidden}" class="pagination-container">
    <el-pagination
      :background="background"
      :current-page.sync="currentPage"
      :page-size.sync="pageSize"
      :layout="layout"
      :page-sizes="pageSizes"
      :total="total"
      v-bind="$attrs"
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
    />
  </div>
</template>
 
<script>
 
export default {
  name: 'Pagination',
  props: {
    total: {
      required: true,
      type: Number
    },
    page: {
      type: Number,
      default: 1
    },
    limit: {
      type: Number,
      default: 20
    },
    pageSizes: {
      type: Array,
      default () {
        return [10, 20, 50, 100]
      }
    },
    layout: {
      type: String,
      default: 'prev, pager, next,jumper, total ,sizes '
    },
    background: {
      type: Boolean,
      default: true
    },
    autoScroll: {
      type: Boolean,
      default: true
    },
    hidden: {
      type: Boolean,
      default: false
    }
  },
  computed: {
    currentPage: {
      get () {
        return this.page
      },
      set (val) {
        this.$emit('update:page', val)
      }
    },
    pageSize: {
      get () {
        return this.limit
      },
      set (val) {
        this.$emit('update:limit', val)
      }
    }
  },
  methods: {
    handleSizeChange (val) {
      this.$emit('pagination', { page: this.currentPage, limit: val })
    },
    handleCurrentChange (val) {
      this.$emit('pagination', { page: val, limit: this.pageSize })
    }
  }
}
</script>
 
<style scoped lang="stylus">
.pagination-container {
  background: #fff;
  padding: 20px 16px 30px;
  /deep/ .el-input__inner{
    width: 100% ;
    height: 28px ;
  }
}
.pagination-container.hidden {
  display: none;
}
.pagination-container
    >>>button
        background rgba(255,255,255,1) !important
        border 1px solid rgba(238,238,238,1)
        width 32px
        height 32px
        i
            color #666666
    >>>.el-pager
        li
            min-width 32px
            height 32px
            border-radius 4px
            background rgba(255,255,255,1)
            border 1px solid rgba(238,238,238,1)
            // font-family PingFangSC-Regular,PingFangSC
            font-weight 400
            font-size 14px
            line-height 32px
            color #666666
            &::not(.disabled).active
                background #0081F0
    >>>.el-pagination__total
        font-size 14px
        font-weight 400
        margin-left 10px
        color #666666
        line-height 32px
    >>>.el-pagination__sizes
        border none
        .el-select.el-select--mini
            width 92px
            height 32px
            .el-input
                width 92px
                height 32px
                background rgba(255,255,255,1)
                border-radius 4px
                border none
                .el-input__inner
                    width 92px !important
                    height 32px
                    font-size 14px
                    color #666666
    >>>.el-pagination__jump
        font-size 14px
        color #666666
        margin 0
        .el-pagination__editor
            margin 0 5px
            .el-input__inner
                width 48px !important
                height 32px
</style>