You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

199 lines
4.0 KiB

<template>
<section
class="data-list-panel"
:class="{ 'data-list-panel--modern-table': modernTable }"
>
<div v-if="$slots.filters || $slots.actions" class="data-list-panel__toolbar">
<div v-if="$slots.filters" class="data-list-panel__filters">
<slot name="filters" />
</div>
<div v-if="$slots.actions" class="data-list-panel__actions">
<slot name="actions" />
</div>
</div>
<div class="data-list-panel__card">
<div v-if="$slots.header" class="data-list-panel__header">
<slot name="header" />
</div>
<div class="data-list-panel__table">
<slot />
</div>
<div v-if="$slots.footer" class="data-list-panel__footer">
<slot name="footer" />
</div>
</div>
</section>
</template>
<script>
export default {
name: 'DataListPanel',
props: {
modernTable: {
type: Boolean,
default: false
}
}
}
</script>
<style lang="scss" scoped>
.data-list-panel {
width: 100%;
}
.data-list-panel__toolbar {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 16px;
margin-bottom: 12px;
}
.data-list-panel__filters {
min-width: 0;
flex: 1;
}
.data-list-panel__actions {
display: flex;
align-items: center;
justify-content: flex-end;
flex: 0 0 auto;
}
.data-list-panel__card {
overflow: hidden;
padding: 14px 16px 10px;
border: 1px solid var(--prototype-divider, #f0f0f2);
border-radius: 8px;
background: #fff;
}
.data-list-panel__header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 12px;
color: var(--prototype-text, #1a1a2e);
font-size: 14px;
font-weight: 600;
}
.data-list-panel__footer {
min-height: 36px;
}
.data-list-panel--modern-table {
::v-deep .data-list-panel__table .el-table,
::v-deep .data-list-panel__table .el-table__expanded-cell {
background: transparent;
}
::v-deep .data-list-panel__table .el-table--border,
::v-deep .data-list-panel__table .el-table--group {
border: 0;
}
::v-deep .data-list-panel__table .el-table--border::after,
::v-deep .data-list-panel__table .el-table--group::after,
::v-deep .data-list-panel__table .el-table__cell {
border-right: 0;
}
::v-deep .data-list-panel__table .el-table::before {
height: 1px;
background: var(--prototype-divider, #f0f0f2);
}
::v-deep .data-list-panel__table th.el-table__cell {
background: #fafbfc;
}
}
::v-deep .data-list-filter-form {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 8px;
}
::v-deep .data-list-filter-form .el-form-item {
margin: 0;
}
::v-deep .data-list-filter-form .el-form-item__label {
display: none;
}
::v-deep .data-list-filter-form .el-input,
::v-deep .data-list-filter-form .el-select {
width: 168px !important;
}
::v-deep .data-list-filter-form .el-date-editor {
width: 218px !important;
}
::v-deep .data-list-actions {
display: flex;
align-items: center;
margin: 0 !important;
white-space: nowrap;
}
::v-deep .data-list-actions .el-col {
float: none;
width: auto;
padding-right: 0 !important;
padding-left: 6px !important;
}
::v-deep .data-list-actions .el-col:first-child {
padding-left: 0 !important;
}
::v-deep .data-list-actions .top-right-btn {
float: none;
margin-left: 8px;
}
::v-deep .data-list-table .data-list-operation-column .cell {
white-space: nowrap;
}
@media (max-width: 1200px) {
.data-list-panel__toolbar {
flex-direction: column;
}
.data-list-panel__actions {
width: 100%;
justify-content: flex-start;
}
}
@media (max-width: 768px) {
.data-list-panel__card {
padding: 10px;
}
::v-deep .data-list-filter-form,
::v-deep .data-list-actions {
width: 100%;
}
::v-deep .data-list-actions {
flex-wrap: wrap;
gap: 8px 0;
}
::v-deep .data-list-filter-form .el-form-item,
::v-deep .data-list-filter-form .el-input,
::v-deep .data-list-filter-form .el-select,
::v-deep .data-list-filter-form .el-date-editor {
width: 100% !important;
}
}
</style>