123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- <template>
- <div class="cont-table">
- <!-- :image="nonedataImg" -->
- <el-empty description=" " v-if="table.data.length == 0" />
- <el-table
- :data="table.data"
- v-else
- style="width: 100%"
- :show-overflow-tooltip="true"
- header-row-class-name="datatable"
- row-class-name="datarow"
- fit
- >
- <el-table-column label="序号" width="70px">
- <template slot-scope="scope">{{ scope.$index + 1 }}</template>
- </el-table-column>
- <el-table-column
- v-for="(item, index) in cloumn"
- :prop="item.prop"
- :label="item.label"
- :key="index"
- show-overflow-tooltip
- :width="item.width || null"
- >
- <template #default="scope">
- <slot
- v-if="item.slot"
- :name="item.slot ? item.slot : ''"
- v-bind="scope"
- ></slot>
- <span v-else>{{ scope.row[item.prop] || "-" }}</span>
- </template>
- </el-table-column>
- </el-table>
- <div class="tabs-pagation" v-if="table.data.length">
- <div class="font">共{{ table.total }}条记录</div>
- <!-- <el-pagination class="tabone-pagination" background layout="prev, pager, next" :current-page="pageNum"
- :pager-count="5" :page-size="5" :total="table.total" @current-change="changePage" /> -->
- <el-pagination
- :current-page="pageNum"
- :page-size="pageSize"
- :small="false"
- :disabled="false"
- :background="true"
- layout="prev, pager, next, jumper,sizes"
- :page-sizes="[10, 15, 20, 30, 50]"
- :total="table.total"
- @size-change="handleSizeChange"
- @current-change="changePage"
- />
- </div>
- </div>
- </template>
- <script >
- export default {
- components: {},
- props: {
- cloumn: {
- type: Array,
- default: [],
- },
- table: {
- type: Object,
- },
- },
- data() {
- return {
- pageNum: 1,
- pageSize: 10,
- };
- },
- mounted() {},
- methods: {
- // 搜索
- searchFun() {
- this.$emit("search", {
- pageIndex: this.pageNum,
- size: this.pageSize,
- });
- },
- // 修改当前页数
- changePage(v) {
- this.pageNum = v;
- this.searchFun();
- },
- handleSizeChange(v) {
- this.pageSize = v;
- this.searchFun();
- },
- },
- beforeDestroy() {},
- watch: {},
- };
- // searchFun()
- </script>
- <style lang="scss" scoped>
- .el-table {
- height: calc(100% - 50px);
- }
- .tabs-pagation {
- position: absolute;
- right: 30px;
- }
- //@import url(../assets/styles/tabs.scss);
- </style>
|