From efb27aff0a6bd195e097c04b102ef6d562a95b16 Mon Sep 17 00:00:00 2001 From: Vben Date: Fri, 26 Feb 2021 20:15:50 +0800 Subject: [PATCH] style(table): remove unless style --- build/vite/plugin/imagemin.ts | 4 +- .../Table/src/components/TableFooter.vue | 3 + .../Table/src/hooks/useTableScroll.ts | 2 +- src/components/Table/src/style/index.less | 176 +++++++++--------- src/design/public.less | 4 +- 5 files changed, 96 insertions(+), 93 deletions(-) diff --git a/build/vite/plugin/imagemin.ts b/build/vite/plugin/imagemin.ts index a3a0144d..6ca19230 100644 --- a/build/vite/plugin/imagemin.ts +++ b/build/vite/plugin/imagemin.ts @@ -16,10 +16,10 @@ export function configImageminPlugin() { quality: 75, }, mozjpeg: { - quality: 65, + quality: 8, }, pngquant: { - quality: [0.65, 0.9], + quality: [0.8, 0.9], speed: 4, }, svgo: { diff --git a/src/components/Table/src/components/TableFooter.vue b/src/components/Table/src/components/TableFooter.vue index 6c9d7e17..4028f9e2 100644 --- a/src/components/Table/src/components/TableFooter.vue +++ b/src/components/Table/src/components/TableFooter.vue @@ -75,12 +75,15 @@ Reflect.deleteProperty(columns[index], 'customRender'); } } + if (table.getRowSelection() && hasRowSummary) { + const isFixed = columns.some((col) => col.fixed === 'left'); columns.unshift({ width: 60, title: 'selection', key: 'selectionKey', align: 'center', + ...(isFixed ? { fixed: 'left' } : {}), customRender: ({ record }) => record[SUMMARY_ROW_KEY], }); } diff --git a/src/components/Table/src/hooks/useTableScroll.ts b/src/components/Table/src/hooks/useTableScroll.ts index 83851b49..d2a7cf09 100644 --- a/src/components/Table/src/hooks/useTableScroll.ts +++ b/src/components/Table/src/hooks/useTableScroll.ts @@ -75,7 +75,7 @@ export function useTableScroll( // Table height from bottom height-custom offset const paddingHeight = 32; - const borderHeight = 2 * 2; + const borderHeight = 0; // Pager height let paginationHeight = 2; if (!isBoolean(pagination)) { diff --git a/src/components/Table/src/style/index.less b/src/components/Table/src/style/index.less index bd0da390..55b93a2d 100644 --- a/src/components/Table/src/style/index.less +++ b/src/components/Table/src/style/index.less @@ -13,9 +13,9 @@ border-radius: 4px; } - .ant-table-wrapper { - border-radius: 2px; - } + // .ant-table-wrapper { + // border-radius: 2px; + // } } &-row__striped { @@ -37,7 +37,7 @@ .ant-table-wrapper { padding: 8px; background: #fff; - border-radius: 4px; + border-radius: 2px; .ant-table-title { padding: 0 0 8px 0 !important; @@ -50,9 +50,9 @@ // .ant-table { - width: 100%; - overflow-x: hidden; - border: none; + // width: 100%; + // overflow-x: hidden; + // border: none; &-title { display: flex; @@ -62,50 +62,50 @@ align-items: center; } - .ant-table-thead > tr > th, - .ant-table-header { - background: #f1f3f4; - background-color: #f1f3f4 !important; - } + // .ant-table-thead > tr > th, + // .ant-table-header { + // background: #f1f3f4; + // background-color: #f1f3f4 !important; + // } .ant-table-tbody > tr.ant-table-row-selected td { background: fade(@primary-color, 8%) !important; } } - .ant-table-bordered .ant-table-header > table, - .ant-table-bordered .ant-table-body > table, - .ant-table-bordered .ant-table-fixed-left table, - .ant-table-bordered .ant-table-fixed-right table { - border: 1px solid @border-color !important; - } + // .ant-table-bordered .ant-table-header > table, + // .ant-table-bordered .ant-table-body > table, + // .ant-table-bordered .ant-table-fixed-left table, + // .ant-table-bordered .ant-table-fixed-right table { + // border: 1px solid @border-color !important; + // } - .ant-table-thead { - tr { - border: none; - } + // .ant-table-thead { + // tr { + // border: none; + // } - th { - border: none; - } - } + // th { + // border: none; + // } + // } - .ant-table-bordered .ant-table-tbody > tr > td { - border-bottom: 1px solid @border-color !important; + // .ant-table-bordered .ant-table-tbody > tr > td { + // border-bottom: 1px solid @border-color !important; - &:last-child { - border-right: none !important; - } - } + // &:last-child { + // border-right: none !important; + // } + // } - .ant-table.ant-table-bordered .ant-table-footer, - .ant-table.ant-table-bordered .ant-table-title { - border: 1px solid @border-color !important; - } + // .ant-table.ant-table-bordered .ant-table-footer, + // .ant-table.ant-table-bordered .ant-table-title { + // border: 1px solid @border-color !important; + // } - .ant-table-bordered.ant-table-empty .ant-table-placeholder { - border: 1px solid @border-color !important; - } + // .ant-table-bordered.ant-table-empty .ant-table-placeholder { + // border: 1px solid @border-color !important; + // } .ant-table-tbody > tr > td, .ant-table-tbody > tr > th, @@ -114,61 +114,61 @@ white-space: pre; } - .ant-table-row-cell-last { - border-right: none !important; - } + // .ant-table-row-cell-last { + // border-right: none !important; + // } - .ant-table-bordered .ant-table-thead > tr > th, - .ant-table-bordered .ant-table-tbody > tr > td { - border-right: 1px solid @border-color !important; - } + // .ant-table-bordered .ant-table-thead > tr > th, + // .ant-table-bordered .ant-table-tbody > tr > td { + // border-right: 1px solid @border-color !important; + // } .ant-pagination { margin: 10px 0 0 0; } - .ant-table-body { - overflow-x: auto !important; - overflow-y: scroll !important; - } - - .ant-table-header { - margin-bottom: 0 !important; - overflow-x: hidden !important; - overflow-y: scroll !important; - } - - .ant-table-fixed-right { - right: -1px; - - .ant-table-header { - border-left: 1px solid @border-color !important; - - .ant-table-fixed { - border-bottom: none; - - .ant-table-thead th { - background: rgb(241, 243, 244); - } - } - } - } - - .ant-table-fixed-left { - .ant-table-header { - overflow-y: hidden !important; - } - - .ant-table-fixed { - border-bottom: none; - } - } - - .ant-table-bordered .ant-table-thead > tr:not(:last-child) > th, - .ant-table-tbody > tr > td { - word-break: break-word; - border-color: @border-color !important; - } + // .ant-table-body { + // overflow-x: auto !important; + // overflow-y: scroll !important; + // } + + // .ant-table-header { + // margin-bottom: 0 !important; + // overflow-x: hidden !important; + // overflow-y: scroll !important; + // } + + // .ant-table-fixed-right { + // right: -1px; + + // .ant-table-header { + // border-left: 1px solid @border-color !important; + + // .ant-table-fixed { + // border-bottom: none; + + // .ant-table-thead th { + // background: rgb(241, 243, 244); + // } + // } + // } + // } + + // .ant-table-fixed-left { + // .ant-table-header { + // overflow-y: hidden !important; + // } + + // .ant-table-fixed { + // border-bottom: none; + // } + // } + + // .ant-table-bordered .ant-table-thead > tr:not(:last-child) > th, + // .ant-table-tbody > tr > td { + // word-break: break-word; + // border-color: @border-color !important; + // } .ant-table-footer { padding: 0; diff --git a/src/design/public.less b/src/design/public.less index 46697a83..c93cac96 100644 --- a/src/design/public.less +++ b/src/design/public.less @@ -8,8 +8,8 @@ // ================================= ::-webkit-scrollbar { - width: 8px; - height: 10px; + width: 7px; + height: 8px; } // ::-webkit-scrollbar-track { -- GitLab