diff --git a/package.json b/package.json index 83fa14dd5f..cf05b5bbe0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vxe-table", - "version": "4.9.24-beta.1", + "version": "4.9.24", "description": "一个基于 vue 的 PC 端表格组件,支持增删改查、虚拟树、拖拽排序,懒加载、快捷菜单、数据校验、树形结构、打印、导入导出、自定义模板、渲染器、JSON 配置式...", "scripts": { "update": "npm install --legacy-peer-deps", diff --git a/packages/table/module/custom/panel.ts b/packages/table/module/custom/panel.ts index e2dd75a8fb..e655f952e8 100644 --- a/packages/table/module/custom/panel.ts +++ b/packages/table/module/custom/panel.ts @@ -456,7 +456,12 @@ export default defineComponent({ evnt.preventDefault() const offsetY = evnt.clientY - optEl.getBoundingClientRect().y const dragPos = offsetY < optEl.clientHeight / 2 ? 'top' : 'bottom' - if ((dragCol && dragCol.id === column.id) || (!isCrossDrag && column.level === 1) || (!immediate && column.level > 1) || column.renderFixed) { + if ( + (dragCol && dragCol.id === column.id) || + (!isCrossDrag && column.level > 1) || + (!immediate && column.level > 1) || + column.renderFixed + ) { showDropTip(evnt, optEl, false, dragPos) return } diff --git a/packages/table/src/body.ts b/packages/table/src/body.ts index f694551c79..736fd45716 100644 --- a/packages/table/src/body.ts +++ b/packages/table/src/body.ts @@ -487,7 +487,7 @@ export default defineComponent({ class: trClass, rowid: rowid, style: rowStyle ? (XEUtils.isFunction(rowStyle) ? rowStyle(params) : rowStyle) : null, - key: rowKey || rowOpts.useKey || rowOpts.drag || treeConfig ? rowid : $rowIndex, + key: rowKey || rowOpts.useKey || rowOpts.drag || columnOpts.drag || treeConfig ? rowid : $rowIndex, ...trOn }, tdVNs) ) diff --git a/packages/table/src/table.ts b/packages/table/src/table.ts index 29897a4547..ea1c0bdb15 100644 --- a/packages/table/src/table.ts +++ b/packages/table/src/table.ts @@ -8201,6 +8201,9 @@ export default defineComponent({ 'is--virtual-x': scrollXLoad, 'is--virtual-y': scrollYLoad }], + style: { + '--vxe-ui-table-drag-column-move-delay': `${Math.max(0.05, Math.min(0.3, tableData.length / 800))}s` + }, spellcheck: false, onKeydown: keydownEvent }, [ diff --git a/styles/components/table-module/custom.scss b/styles/components/table-module/custom.scss index 317466ab39..e9784a0a58 100644 --- a/styles/components/table-module/custom.scss +++ b/styles/components/table-module/custom.scss @@ -439,7 +439,9 @@ } .vxe-table-custom--list-move { - transition: transform 0.35s; + transition-property: transform; + transition-duration: 0.35s; + transition-delay: 0.05s; } .vxe-table-custom-popup--column-sort-placeholder { diff --git a/styles/components/table.scss b/styles/components/table.scss index 25baaadaff..7d68c429e9 100644 --- a/styles/components/table.scss +++ b/styles/components/table.scss @@ -1305,7 +1305,9 @@ } } .vxe-header--col-list-move { - transition: transform 0.35s; + transition-property: transform; + transition-duration: 0.35s; + transition-delay: var(--vxe-ui-table-drag-column-move-delay, 0.3s); } .vxe-table--drag-col-line, @@ -1367,7 +1369,9 @@ } } .vxe-body--row-list-move { - transition: transform 0.35s; + transition-property: transform; + transition-duration: 0.35s; + transition-delay: 0.05s; } .vxe-table--drag-sort-tip { display: none;