@import './variable';
// 列表页默认样式
.list-wrapper {
    line-height: 1.5;
    // 标题
    &:first-child > .title-wrapper:first-child {
        border-bottom: $--border-main;
    }
    // 筛选区域样式
    .search-wrapper {
        border-bottom: $--border-main;
        margin: $--space-big $--space $--space;
        padding-bottom: $--space-big;
        .form-wrapper {
            margin-bottom: 0;
        }
        .el-form-item__content,
        .search-btn-wrapper {
            display: flex;
            align-items: center;
        }
        .title-wrapper {
            padding: 0 0 $--space;
        }
        .el-col-8 {
            &:nth-child(3n) {
                padding-left: 12px;
            }
            &:nth-child(3n+1) {
                padding-right: 12px;
            }
            &:nth-child(3n+2) {
                padding: 0 6px;
            }
        }
        & + .btn-wrapper {
            margin-top: 0;
        }
    }
    .search-btn-wrapper {
        justify-content: flex-end;
        font-size: 0;

        .fold-btn {
            padding: 0 10px;
            min-width: 0;
        }
    }

    .form-wrapper {
        .is-error.el-form-item .el-form-item__content {
            border: none;
            &::before {
                display: none;
            }
        }
    }

    // 按钮区域样式
    .btn-wrapper {
        text-align: right;
        font-size: 0;
        margin: $--space $--space 0;
        position: relative;
        .el-button {
            margin-bottom: $--space;
        }
        & ~ .table-wrapper {
            margin-top: 0;
        }
        .btn-wrapper-list {
            flex: 1;
        }
        .upload-box {
            width: auto;
        }
        > * {
            font-size: 14px;
        }
    }
    .btn-item {
        & ~ .btn-item {
            margin-left: 10px;
        }
        &.cell-btn-item .el-button--text:not(.is-disabled) { // 行内按钮（单元格内可操作文字）
            color: #3ca0f6;
        }
    }
    .el-upload-list {
        display: none;
    }
    .el-dropdown {
        vertical-align: middle;
    }

    // 表格区域样式
    .table-btn-item .el-button,
    .table-btn-item {
        padding: 0;
        margin-bottom: 0;
        line-height: 23px;
        .el-button {
            // 功能按钮
            border: 0 none;
            background: none;
        }
    }
    // 表格边框
    .el-table.el-table--border {
        border: none;
        td,
        th,
        .el-table__body-wrapper .el-table--border.is-scrolling-left ~ .el-table__fixed {
            border-color: $--border-color-light;
        }
        tr > td,
        tr > th.is-leaf {
            border-bottom-color: rgba(206, 206, 206, 0.3);
        }
        tr > td:last-child,
        tr:first-child > th:last-child,
        thead.has-gutter tr:first-child th:nth-last-of-type(2) {
            border-right: none;
        }
        &::after,
        &::before,
        .el-table__fixed-right::before,
        .el-table__fixed::before {
            background-color: transparent;
        }
    }
    .el-table {
        td:not(.list-operation) {
            .image-viewer-wrapper,
            .btn-item {
                width: 100%;
                .el-button {
                    width: 100%;
                    box-sizing: border-box;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    display: inline-block;
                    text-align: left;
                    &.el-button--text {
                        user-select: all;
                    }
                }
              
            }
            .btn-download,
            .btn-delete,
            .btn-preview {
                width: auto;
            }
            // 列对齐方式
            &.is-left {
                .form-item-content { // formExtend
                    justify-content: flex-start;
                }
                .cell-btn-item .el-button { // button
                    text-align: left;
                }
            }
            &.is-center {
                .form-item-content {
                    justify-content: center;
                }
                .cell-btn-item .el-button {
                    text-align: center;
                }
            }
            &.is-right {
                .form-item-content {
                    justify-content: flex-end;
                }
                .cell-btn-item .el-button {
                    text-align: right;
                }
            }
        }
        .cell {
            white-space: nowrap;
            // white-space: pre-line;
            .btn-item {
                .el-button {
                    padding: 0;
                }
                span {
                    // white-space: normal;
                    line-height: 18px;
                    font-weight: normal;
                }
            }
            .el-radio > .el-radio__input {
                margin-right: -16px;
            }
            .form-wrapper {
                margin-bottom: 0;
                // 表单校验提示信息
                .el-form-item__error {
                    text-align: left;
                    top: 3px;
                }
            }
            .el-form-item__content {
                overflow: hidden;
            }
            .form-item-content {
                display: flex;
                align-items: center;

                .form-read_text {
                    min-width: 0;
                    .form-read-text-str {
                        overflow: hidden;
                        text-overflow: ellipsis;
                        width: 100%;
                    }
                }

                .el-input-number,
                .el-range-separator,
                .el-input__inner,
                .el-input__icon {
                    line-height: $--height-list;
                    height: $--height-list;
                }
                .el-input-number__increase,
                .el-input-number__decrease {
                    height: $--height-list - 2;
                    line-height: $--height-list - 2;
                }
                .is-controls-right {
                    .el-input-number__decrease,
                    .el-input-number__increase {
                        height: ($--height-list - 2) / 2;
                        line-height: ($--height-list - 2) / 2;
                    }
                }
            }
            .cell-image-box .cell-img {
                width: 100%;
            }
            // 自定义表格头部
            .my-table-header {
                font-weight: bold;
                text-align: center;
                display: inline-block;
                vertical-align: middle;
                white-space: nowrap;
                text-overflow: ellipsis;
                overflow: hidden;
                box-sizing: border-box;
                min-width: 40px;
                // 减去20是为了让后面的排序的图标显示。
            }
            .my-tooltip {
                vertical-align: middle;
            }
            .caret-wrapper {
                top: 2px;
            }
        }
        .el-button + .el-button {
            margin: 0 5px;
        }
        // 暂无数据
        .el-table__empty-text {
            line-height: 24px;
            position: absolute;
            top: 50%;
            left: 0;
            right: 0;
            width: auto;
            margin-top: -80px;
            padding-top: 136px;
            background: url('../../../images/table-empty.png') no-repeat top center / 144px;
        }
        .el-table__empty-block {
            min-height: 308px;
        }
        &.data-none .el-table__body-wrapper {
            overflow-y: auto;
        }
        // 多选按钮
        .el-table-column--selection .cell {
            padding: 0;
        }
        .list-expand {
            .el-button {
                width: auto;
                min-width: 0;
            }
        }
        // 操作列按钮
        .list-operation {
            .cell {
                white-space: normal;
            }
            .btn-item {
                margin: 0;
                &:last-child .el-button {
                    margin-right: 0;
                }
            }
            .el-button {
                font-size: 14px;
                line-height: 16px;
                padding: 0;
                height: auto;
                width: auto;
                min-width: 0;
                font-weight: normal;
                margin-right: $--space;
                &.operation-delete:not(.el-button--danger) { // 列表操作按钮删除类型
                    color: $--color-danger;
                    &:hover {
                        color: $--color-danger-hover;
                    }
                }
            }
        }
    }
    .table-wrapper {
        position: relative;
        margin: $--space;
        box-sizing: border-box;
        .thumbnail .img {
            width: 100%;
        }
        .el-form-item {
            margin-bottom: 0;
        }
        .bk-setting-btn {
            position: absolute;
            right: 0;
            top: 0;
            z-index: 5;
            width: 24px;
            height: 24px;
            background: $--color-white;
            border-radius: 0 0 0 84px;
            box-shadow: -2px 2px 4px 0 rgba(0, 0, 0, 0.1);
            padding-left: 7px;
            padding-top: 3px;
            box-sizing: border-box;
            cursor: pointer;
            .my-icon-btn {
                font-size: 14px;
                color: $--color-primary;
            }
            .my-icon {
                vertical-align: top;
                font-size: 14px;
                color: $--color-text-regular;
            }
            &:hover {
                background: $--color-primary;
                box-shadow: none;
                .my-icon {
                    color: $--color-white;
                }
                .bk-down-btn {
                    display: block;
                }
            }
            .bk-down-btn {
                box-sizing: border-box;
                display: none;
                padding-top: 20px;
                z-index: 99;
                position: absolute;
                right: 0;
                top: 10px;
                width: 120px;
                border-radius: 4px;
                .bdb-main {
                    box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
                }
                .bdb-item {
                    background: $--color-white;
                    line-height: 32px;
                    font-size: 14px;
                    color: $--color-text-regular;
                    font-weight: 400;
                    padding-left: 10px;
                    cursor: pointer;
                }
                .bdb-item2 {
                    position: relative;
                    &:hover {
                        .bi-left {
                            display: block;
                        }
                    }
                    .bi-left {
                        display: none;
                        position: absolute;
                        right: 120px;
                        top: -40px;
                        padding-right: 8px;
                        .bil-main {
                            position: relative;
                            padding: 12px;
                            width: 128px;
                            height: 110px;
                            background: $--color-white;
                            box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
                            .bim-arrow {
                                top: 50%;
                                transform: translateY(-50%) rotate(45deg);
                                border-color: #fff #fff transparent transparent;
                                box-shadow: 3px -3px 7px rgba(0, 0, 0, 0.07);
                                right: -4px;
                                background: 0 0;
                                border-style: solid;
                                border-width: 4px;
                                display: block;
                                height: 8px;
                                position: absolute;
                                width: 8px;
                            }
                            .bil-top {
                                display: flex;
                                .bit-item {
                                    position: relative;
                                    cursor: pointer;
                                    width: 48px;
                                    height: 46px;
                                    background: $--color-white;
                                    border: 1px solid #e7e9eb;
                                    border-radius: 2px;
                                    padding: 4px;
                                    &:hover {
                                        border: 1px solid $--color-primary;
                                        .bit-title {
                                            color: $--color-primary;
                                        }
                                        .bit-check {
                                            display: block;
                                        }
                                    }
                                    &.bit-active {
                                        border: 1px solid $--color-primary;
                                        .bit-title {
                                            color: $--color-primary;
                                        }
                                        .bit-check {
                                            display: block;
                                        }
                                    }
                                    .bit-title {
                                        font-size: 12px;
                                        color: $--color-text-regular;
                                        line-height: 16px;
                                        font-weight: 400;
                                    }
                                    .bit-check {
                                        display: none;
                                        position: absolute;
                                        right: 0;
                                        top: 0;
                                        width: 14px;
                                        height: 14px;
                                        img {
                                            vertical-align: top;
                                            width: 100%;
                                        }
                                    }
                                    .bit-disp {
                                        width: 40px;
                                        height: 18px;
                                        img {
                                            width: 100%;
                                        }
                                    }
                                }
                            }
                            .bil-bottom {
                                padding-top: 8px;
                                width: 96px;
                                // height: 16px;
                                font-size: 12px;
                                color: $--color-info;
                                line-height: 16px;
                                font-weight: 400;
                                .silb-sp {
                                    color: $--color-warning;
                                }
                            }
                        }
                    }
                }
                .bdb-item:hover {
                    color: $--color-primary;
                }
                .bdb-title {
                    background: #fff;
                    padding-left: 10px;
                    line-height: 32px;
                    cursor: text;
                    font-size: 12px;
                    color: #909399;
                }
            }
        }
        .el-table__fixed-right-patch {
            background-color: #f1f2f5;
        }
        .el-table__expanded-cell {
            padding: 0 !important;
            z-index: 4;
        }
        .el-table__expand-icon {
            display: none;
        }
    }
    .additional-column {
        color: $--color-text-regular;
    }

    .noniusPagination {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 20px 0;

        .current,
        .index {
            font-size: 14px;
            color: $--color-text-regular;
        }
        .current {
            margin-right: 15px;
            &:not(:first-of-type) {
                margin-left: 15px;
            }
        }

        .index {
            cursor: pointer;
        }
    }
    &.list-tree .el-table td:first-of-type .cell {
        text-align: left;
    }
}

// el-tab紧跟buttonConfig
.el-tabs + .list-wrapper > .list-internal-wrapper > .section-wrapper > .btn-wrapper:first-child {
    margin-top: 10px;
}
// 全局覆盖表格样式
.el-table th,
.el-table td {
    font-weight: normal;
}
.el-table-column--selection .cell {
    padding-right: 10px;
}
.el-table {

    // 表头样式
    thead {
        color: $--color-text-primary;
        th {
            padding: 10px 0;
            background-color: $--background-color-base;
            &.gutter {
                display: table-cell !important; // 解决chrome表头错位问题
            }
        }
        .cell {
            font-weight: bold;
            text-align: center;
        }
    }
    // 表头排序
    .caret-wrapper {
        height: 16px;
        .ascending {
            border-bottom-color: $--color-text-primary;
            top: -4px;
        }
        .descending {
            border-top-color: $--color-text-primary;
            bottom: -2px;
        }
    }
    // 单元格样式
    tbody {
        td {
            padding: 4px 0;
            height: 40px;
        }
    }
    // 行背景色
    .el-table__body tr.hover-row > td,
    .el-table__body tr.hover-row.current-row > td,
    .el-table__body tr.hover-row.el-table__row--striped > td,
    .el-table__body tr.hover-row.el-table__row--striped.current-row > td,
    .el-table__body tr.current-row > td,
    &.el-table--enable-row-hover .el-table__body tr:hover > td {
        background-color: $--table-row-hover-background-color;
    }
    &.table-density {
        // 紧凑模式
        // 表头样式
        thead {
            th {
                padding: 4px 0;
                font-size: 12px;
            }
        }
        // 单元格样式
        tbody {
            td {
                padding: 4px 0;
                height: 18px;
                line-height: 18px;
                font-size: 12px;
                .cell {
                    line-height: 18px;
                    font-size: 12px;
                    .el-button {
                        font-size: 12px;
                        line-height: 18px;
                        height: 24px;
                    }
                    .el-input {
                        font-size: 12px;
                        line-height: 18px;
                        height: 24px;
                        .el-input__inner {
                            line-height: 18px !important;
                            height: 24px !important;
                        }
                        .el-input__icon {
                            line-height: 24px !important;
                            height: 24px !important;
                        }
                    }
                    .el-input-number {
                        line-height: 24px;
                        height: 24px;
                        .el-input-number__increase,
                        .el-input-number__decrease {
                            height: 22px;
                            line-height: 22px;
                        }
                        .is-controls-right {
                            .el-input-number__decrease,
                            .el-input-number__increase {
                                height: 11px;
                                line-height: 11px;
                            }
                        }
                    }
                }
            }
        }
    }
}
// table单元格详情浮窗样式
.el-tooltip__popper.is-dark,
.el-tooltip__popper.is-light {
    max-width: 320px;
}
// table-footer 页脚
.el-table-footer-wrapper {
    position: relative;
    overflow: hidden;
    margin: 10px;
}
.el-table-footer-wrapper.is-scrolling-none .el-table-footer-wrapper__fixed-left,
.el-table-footer-wrapper.is-scrolling-none .el-table-footer-wrapper__fixed-right,
.el-table-footer-wrapper.is-scrolling-left .el-table-footer-wrapper__fixed-left,
.el-table-footer-wrapper.is-scrolling-right .el-table-footer-wrapper__fixed-right {
    box-shadow: none;
}
.el-table-footer-wrapper::after {
    content: '';
    position: absolute;
    z-index: 1;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    background-color: $--border-color-lighter;
}
.el-table-footer-wrapper td,
.el-table-footer-wrapper th {
    padding: 4px 0;
    min-width: 0;
    box-sizing: border-box;
    text-overflow: ellipsis;
    vertical-align: middle;
    position: relative;
    font-size: 12px;
}
.el-table-footer-wrapper.el-table-footer--small td,
.el-table-footer-wrapper.el-table-footer--small th {
    padding-top: 8px;
    padding-bottom: 8px;
}
.el-table-footer-wrapper.el-table-footer--mini td,
.el-table-footer-wrapper.el-table-footer--mini th {
    padding-top: 6px;
    padding-bottom: 6px;
}
.el-table-footer-wrapper td {
    border-bottom: 1px solid $--border-color-lighter;
    background-color: $--background-color-light;
    color: $--color-text-regular;
}
.el-table-footer-wrapper td.is-right {
    text-align: right;
}
.el-table-footer-wrapper td.is-center {
    text-align: center;
}
.el-table-footer-wrapper .cell {
    padding-left: 10px;
    padding-right: 10px;
    box-sizing: border-box;
    white-space: normal;
    word-break: break-all;
    line-height: 23px;
}
.el-table-footer-wrapper--border {
    td {
        border-right: 1px solid $--border-color-light;
        &:last-child {
            border-right: none;
        }
    }
}
.el-table-footer-wrapper th.gutter {
    border-bottom: 1px solid $--border-color-lighter;
}
.el-table-footer {
    overflow: hidden;
}
.el-table-footer table,
.el-table-footer-wrapper__fixed-left table,
.el-table-footer-wrapper__fixed-right table {
    table-layout: fixed;
    border-collapse: separate;
}
.el-table-footer-wrapper__fixed-left,
.el-table-footer-wrapper__fixed-right {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 3;
    overflow: hidden;
    box-shadow: $--table-fixed-box-shadow;
}
.el-table-footer-wrapper__fixed-right {
    left: auto;
}
.el-table-footer-wrapper__fixed-left table,
.el-table-footer-wrapper__fixed-right table {
    position: absolute;
    top: 0;
    left: 0;
}
.el-table-footer-wrapper__fixed-right table {
    left: auto;
    right: 0;
}

// 分页样式
.pagination-wrapper {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: $--color-text-primary;
    margin: $--space 0;
    padding: 0 $--space * 2;
    .label-style {
        font-size: 13px !important;
        line-height: 20px;
    }

    .pagination-content {
        margin-left: auto;

        @extend .label-style;

        box-sizing: border-box;
        text-align: center;
        font-weight: normal;
        display: flex;
        align-items: center;

        .el-pagination__total {
            @extend .label-style;

            height: 20px;
        }
        .el-pagination__sizes {
            margin-right: 0;
            order: 1;
            font-size: 0;
            line-height: 20px;
            height: 20px;
            vertical-align: middle;

            .el-input--mini .el-input__inner {
                @extend .label-style;

                height: 20px;
                line-height: 20px;
                max-width: 85px;
                padding-left: 0;
                padding-right: 20px;
                vertical-align: middle;
            }
            .el-input__suffix {
                right: 8px;
                height: 20px;
                transform: scale(1);
                -webkit-transform: scale(1);
            }
            .el-select__caret {
                line-height: 20px;
                font-size: 13px;
            }
            .el-select .el-input {
                display: flex;
                align-items: center;
                justify-content: center;
            }
        }
        .btn-prev,
        .btn-next {
            background-color: transparent;
            min-width: 20px;
            .el-icon {
                width: 20px;
                height: 20px;
                line-height: 18px;
                box-sizing: border-box;
                border: 1px solid $--border-color-base;
                border-radius: 2px;
                color: $--border-color-base;
                margin: 0;
            }
            &:disabled {
                display: none;
            }
        }
        .el-pager {
            font-size: 0;

            .number {
                margin: 0;
                padding: 0 5px;
                min-width: 20px;
                height: 20px;
                line-height: 18px;
                font-size: 13px;
                border: 1px solid transparent;
                text-align: center;
                vertical-align: middle;
                background-color: transparent;
                &:hover {
                    border-color: $--color-primary;
                }
                & ~ .number {
                    margin-left: 5px;
                }
            }
            .el-icon.more.btn-quicknext,
            .el-icon.more.btn-quickprev {
                padding: 1px 0 0 5px;
                background-color: transparent;
                width: 20px;
                height: 20px;
                line-height: 20px;
                margin: 0;
                &::before {
                    line-height: 20px;
                }
            }
        }
        .el-pagination__jump {
            @extend .label-style;

            vertical-align: middle;
            height: 20px;
            order: 2;
            .el-input.el-pagination__editor.is-in-pagination {
                @extend .label-style;

                height: 20px;
                width: auto;
                min-width: 40px;
                padding: 0;
                margin: 0 6px;
            }
            .el-input__inner {
                height: 20px;
                width: auto;
                min-width: 40px;
                padding: 0 5px;
            }
        }
    }
    .page-skip-box {
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
        .el-input {
            font-size: 13px;
            width: 40px;
            margin: 0 6px;
        }
        .el-input__inner {
            height: 20px;
            line-height: 20px;
            padding: 0 5px;
            text-align: center;
        }
    }
}
.bk-list-alert {
    margin: 10px;
    width: calc(100% - 20px);
    padding: 5px 10px;
    border: 1px solid #ebeef5;
    background-color: $--color-white;
    line-height: 18px;
    transition: opacity 0.2s;
    overflow: hidden;
    opacity: 1;
    display: flex;
    align-items: center;
    border-radius: 3px;
    box-sizing: border-box;
    position: relative;
    .bk-alert__content {
        padding: 0 10px 0 0;
        color: $--color-text-regular;
        .bk-alert__title {
            font-size: 13px;
            line-height: 18px;
        }
    }
    .bk-alert__closebtn {
        top: 8px;
        right: 10px;
        font-size: 12px;
        opacity: 1;
        position: absolute;
        cursor: pointer;
    }
}
