diff --git a/package.json b/package.json index 67bd91a31..14d46de01 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "style": "lib/style.css", "typings": "types/index.d.ts", "dependencies": { - "vxe-pc-ui": "^1.9.20" + "vxe-pc-ui": "^4.0.0" }, "devDependencies": { "@types/resize-observer-browser": "^0.1.11", diff --git a/packages/table/module/custom/hook.ts b/packages/table/module/custom/hook.ts index 533090ea9..d1a4038dd 100644 --- a/packages/table/module/custom/hook.ts +++ b/packages/table/module/custom/hook.ts @@ -20,7 +20,7 @@ VxeUI.hooks.add('tableCustomModule', { // 判断面板不能大于表格高度 let tableHeight = 0 if (el) { - tableHeight = el.clientHeight - 60 + tableHeight = el.clientHeight - 30 } customStore.maxHeight = Math.max(4, tableHeight) } diff --git a/packages/table/src/body.ts b/packages/table/src/body.ts index 6a725fe50..743edce03 100644 --- a/packages/table/src/body.ts +++ b/packages/table/src/body.ts @@ -413,7 +413,7 @@ export default defineComponent({ // 如果行被展开了 if (isExpandRow) { const expandOpts = computeExpandOpts.value - const { height: expandHeight } = expandOpts + const { height: expandHeight, padding } = expandOpts const cellStyle: any = {} if (expandHeight) { cellStyle.height = `${expandHeight}px` @@ -426,7 +426,9 @@ export default defineComponent({ const expandParams = { $table: $xeTable, seq, column: expandColumn, fixed: fixedType, type: renderType, level: rowLevel, row, rowIndex, $rowIndex, _rowIndex } rows.push( h('tr', { - class: 'vxe-body--expanded-row', + class: ['vxe-body--expanded-row', { + 'is--padding': padding + }], key: `expand_${rowid}`, style: rowStyle ? (XEUtils.isFunction(rowStyle) ? rowStyle(expandParams) : rowStyle) : null, ...trOn diff --git a/packages/ui/index.ts b/packages/ui/index.ts index 84e169bbc..e2344ca36 100644 --- a/packages/ui/index.ts +++ b/packages/ui/index.ts @@ -63,7 +63,7 @@ VxeUI.setConfig({ allowFixed: true, allowSort: true, showFooter: true, - placement: 'topRight' + placement: 'top-right' // storage: false, // checkMethod () {} }, diff --git a/styles/components/table-module/custom.scss b/styles/components/table-module/custom.scss index c8a57fb61..372949232 100644 --- a/styles/components/table-module/custom.scss +++ b/styles/components/table-module/custom.scss @@ -59,19 +59,19 @@ border: 1px solid var(--vxe-ui-table-border-color); border-radius: var(--vxe-ui-border-radius); box-shadow: var(--vxe-ui-base-popup-box-shadow); - &.placement--topLeft { + &.placement--top-left { top: 2px; left: 2px; } - &.placement--topRight { + &.placement--top-right { top: 2px; right: 2px; } - &.placement--bottomLeft { + &.placement--bottom-left { bottom: 2px; left: 2px; } - &.placement--bottomRight { + &.placement--bottom-right { bottom: 2px; right: 2px; } diff --git a/styles/components/table.scss b/styles/components/table.scss index 264f35cbe..dfcf4089f 100644 --- a/styles/components/table.scss +++ b/styles/components/table.scss @@ -1041,6 +1041,15 @@ padding-left: 0.5em; } } + .vxe-body--expanded-row { + &.is--padding { + & > .vxe-body--expanded-column { + & > .vxe-body--expanded-cell { + padding: var(--vxe-ui-table-expand-padding-default); + } + } + } + } .vxe-body--expanded-column { border-bottom: var(--vxe-ui-table-border-width) solid var(--vxe-ui-table-border-color); border-right: var(--vxe-ui-table-border-width) solid var(--vxe-ui-table-border-color); diff --git a/styles/theme/base.scss b/styles/theme/base.scss index d840e84e0..a2fa8e13c 100644 --- a/styles/theme/base.scss +++ b/styles/theme/base.scss @@ -75,6 +75,8 @@ $vxe-ui-status-error-color: #f56c6c; --vxe-ui-table-cell-active-area-border-color: var(--vxe-ui-table-cell-area-border-color); --vxe-ui-table-cell-area-background-color: rgba(64,158,255,0.2); + --vxe-ui-table-expand-padding-default: 16px; + --vxe-ui-table-checkbox-range-border-width: 1px; --vxe-ui-table-checkbox-range-border-color: #006af1; --vxe-ui-table-checkbox-range-background-color: rgba(50,128,252,0.2);