<!--
|
* @Date: 2024-01-06 17:40:19
|
* @LastEditors: Sneed
|
* @LastEditTime: 2024-01-16 21:27:05
|
* @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/container/list/index.vue
|
-->
|
<template>
|
<div class="list">
|
<div class="search">
|
<slot name="search"></slot>
|
</div>
|
<div class="table">
|
<slot name="table-tool"></slot>
|
<el-table
|
stripe
|
:data="tableData"
|
v-loading="loading"
|
style="width: 100%;margin-top: 20px;">
|
<slot name="columns"></slot>
|
<!-- <el-table-column
|
prop="date"
|
label="日期"
|
width="180">
|
</el-table-column>
|
<el-table-column
|
prop="name"
|
label="姓名"
|
width="180">
|
</el-table-column>
|
<el-table-column
|
prop="address"
|
label="地址">
|
</el-table-column> -->
|
</el-table>
|
<div v-if="total" class="pagination">
|
<el-pagination
|
style="background: transparent;"
|
:page-size="pageSize"
|
:pager-count="current"
|
layout="prev, pager, next"
|
:total="total">
|
</el-pagination>
|
</div>
|
|
</div>
|
</div>
|
</template>
|
<script>
|
export default {
|
props: {
|
url: {
|
type: String
|
}
|
},
|
data () {
|
return {
|
tableData: [],
|
pageSize: 10,
|
current: 1,
|
total: 0,
|
loading: false
|
}
|
},
|
created () {
|
this.pageQuery()
|
},
|
methods: {
|
pageQuery(params) {
|
this.loading = true
|
this.$http.postJson(this.url,{
|
pageSize: this.pageSize,
|
current: this.current,
|
...params
|
}).then(res => {
|
console.log(res)
|
this.tableData = res.data.records || []
|
this.total = res.data.total
|
}).finally(() => {
|
this.loading = false
|
})
|
}
|
},
|
}
|
</script>
|
<style lang="scss">
|
.list {
|
width: 100%;
|
height: 100%;
|
overflow: auto;
|
.table {
|
|
.el-table::before {
|
background-color: transparent;
|
}
|
.el-table th {
|
color: #E6E5E5;
|
background-color: #182D54;
|
border-bottom: none;
|
}
|
.el-table {
|
color: #E6E5E5;
|
background: transparent;
|
background-color: transparent;
|
border-bottom: none;
|
padding: 0;
|
}
|
.el-table__fixed-right::before, .el-table__fixed::before {
|
background: transparent;
|
}
|
.el-table td, .el-table--striped .el-table__body tr.el-table__row--striped td,.el-table--enable-row-hover .el-table__body tr:hover>td{
|
color: #E6E5E5;
|
border-bottom: none;
|
background: transparent;
|
background-color: transparent;
|
// padding: 0;
|
}
|
.el-table tr{
|
color: #E6E5E5;
|
border-bottom: none;
|
background: transparent;
|
background-color: transparent;
|
border-bottom: none;
|
padding: 0;
|
}
|
.el-table tr.el-table__row--striped {
|
background-color: #182D54!important;
|
|
}
|
// .el-table__header {
|
// color: #E6E5E5;
|
// background: transparent;
|
// background-color: transparent;
|
// border-bottom: none;
|
// padding: 0;
|
// }
|
// .el-table__body-wrapper {
|
// color: #E6E5E5;
|
// background: transparent;
|
// background-color: transparent;
|
// border-bottom: none;
|
// padding: 0;
|
// }
|
.el-table__header-wrapper {
|
border: none;
|
border-bottom: none;
|
padding: 0;
|
}
|
}
|
.pagination {
|
background: transparent;
|
}
|
.el-pager li {
|
background: transparent;
|
}
|
.el-pagination button:disabled {
|
background: transparent;
|
}
|
.el-pagination .btn-next, .el-pagination .btn-prev {
|
background: transparent;
|
}
|
}
|
</style>
|
<style lang="scss" scoped>
|
.list {
|
|
}
|
.search {
|
margin: 20px 30px;
|
padding: 30px 0px;
|
min-height: 160px;
|
display: flex;
|
flex-wrap: wrap;
|
background: url('./search.png') center center no-repeat;
|
background-size: cover;
|
}
|
.table {
|
margin-top: 20px;
|
margin-bottom: 30px;
|
padding: 20px 30px;
|
background: transparent;
|
overflow: auto;
|
.pagination {
|
position: absolute;
|
bottom: 0;
|
right: 40px;
|
}
|
}
|
.table::-webkit-scrollbar {
|
width: 4px; /* Chrome/Safari */
|
}
|
|
/* 定义滑块(thumb)的样式 */
|
.table::-webkit-scrollbar-thumb {
|
background-color: #999; /* Chrome/Safari */
|
}
|
|
/* 当滑块被按下时的样式 */
|
.table::-webkit-scrollbar-thumb:hover {
|
background-color: #666; /* Chrome/Safari */
|
}
|
|
/* 定义两侧边界的样式 */
|
.table::-webkit-scrollbar-track {
|
background-color: #f5f5f5; /* Chrome/Safari */
|
}
|
|
</style>
|