From 62a87b1055f227bd8d92f57fddcf039ae2425969 Mon Sep 17 00:00:00 2001 From: fangsmile <892739385@qq.com> Date: Wed, 8 Apr 2026 16:36:38 +0800 Subject: [PATCH 1/2] fix: fill handle logic about get cell value #5096 --- .gitignore | 3 +- .../auto-fill/fill-handle-origin-value.ts | 40 +++++++++++++++++++ packages/vtable-plugins/demo/menu.ts | 4 ++ .../src/auto-fill/auto-fill-helper.ts | 2 +- skills-lock.json | 15 +++++++ 5 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 packages/vtable-plugins/demo/auto-fill/fill-handle-origin-value.ts create mode 100644 skills-lock.json diff --git a/.gitignore b/.gitignore index 184de956f2..bb1ecf0d10 100644 --- a/.gitignore +++ b/.gitignore @@ -108,4 +108,5 @@ packages/vtable/nodejs/*.png tsconfig.tsbuildinfo .history -.trae/ \ No newline at end of file +.trae/ +.agents/ \ No newline at end of file diff --git a/packages/vtable-plugins/demo/auto-fill/fill-handle-origin-value.ts b/packages/vtable-plugins/demo/auto-fill/fill-handle-origin-value.ts new file mode 100644 index 0000000000..ccf3b386e3 --- /dev/null +++ b/packages/vtable-plugins/demo/auto-fill/fill-handle-origin-value.ts @@ -0,0 +1,40 @@ +import * as VTable from '@visactor/vtable'; +import * as VTablePlugins from '../../src'; + +const CONTAINER_ID = 'vTable'; + +export function createTable() { + const columns: VTable.ColumnsDefine = [ + { + field: 'name', + title: 'Name', + width: 150 + }, + { + field: 'sales', + title: 'Sales', + width: 150, + fieldFormat: rec => { + if (rec.sales) { + return `$${rec.sales}`; + } + return ''; + } + } + ]; + + const records = [{ name: 'John', sales: 100 }, { name: 'Jane', sales: 200 }, { name: 'Doe', sales: 300 }, {}, {}, {}]; + + const option: VTable.ListTableConstructorOptions = { + container: document.getElementById(CONTAINER_ID)!, + columns, + records, + excelOptions: { + fillHandle: true + }, + plugins: [new VTablePlugins.AutoFillPlugin()] + }; + + const instance = new VTable.ListTable(option); + (window as any).tableInstance = instance; +} diff --git a/packages/vtable-plugins/demo/menu.ts b/packages/vtable-plugins/demo/menu.ts index 9600c76c7e..a9718ec900 100644 --- a/packages/vtable-plugins/demo/menu.ts +++ b/packages/vtable-plugins/demo/menu.ts @@ -39,6 +39,10 @@ export const menus = [ path: 'auto-fill', name: 'auto-fill' }, + { + path: 'auto-fill', + name: 'fill-handle-origin-value' + }, { path: 'wps-fill-handle', name: 'wps-fill-handle' diff --git a/packages/vtable-plugins/src/auto-fill/auto-fill-helper.ts b/packages/vtable-plugins/src/auto-fill/auto-fill-helper.ts index a23fc1ec33..84d768821f 100644 --- a/packages/vtable-plugins/src/auto-fill/auto-fill-helper.ts +++ b/packages/vtable-plugins/src/auto-fill/auto-fill-helper.ts @@ -86,7 +86,7 @@ export function openAutoFillMenu(tableInstance: ListTable, endCol: number, endRo export function getCellMatrix(table: ListTable) { return { getValue: (row: number, col: number) => { - const value = table.getCellValue(col, row); + const value = table.getCellOriginValue(col, row); if (typeof value === 'number' || !isNaN(Number(value))) { return { v: value, diff --git a/skills-lock.json b/skills-lock.json new file mode 100644 index 0000000000..486223af00 --- /dev/null +++ b/skills-lock.json @@ -0,0 +1,15 @@ +{ + "version": 1, + "skills": { + "vtable-browser-debugger-assistant": { + "source": "VisActor/VTable", + "sourceType": "github", + "computedHash": "be064dc336796005c403d281243b25684e4f7abc1513125f91d6c65e912bc88b" + }, + "vtable-development-assistant": { + "source": "VisActor/VTable", + "sourceType": "github", + "computedHash": "6f24fceb32b7d460587ed0c8e93c643e969e8102a0a791e0880ad692af07e79a" + } + } +} From 914cb5162ac6642e42bd9066e90df849b0e9cfa0 Mon Sep 17 00:00:00 2001 From: fangsmile <892739385@qq.com> Date: Wed, 8 Apr 2026 16:39:01 +0800 Subject: [PATCH 2/2] docs: update changlog of rush --- ...ll-plugin-getorigincellvalue_2026-04-08-08-39.json | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 common/changes/@visactor/vtable/5096-bug-drag-autofill-plugin-getorigincellvalue_2026-04-08-08-39.json diff --git a/common/changes/@visactor/vtable/5096-bug-drag-autofill-plugin-getorigincellvalue_2026-04-08-08-39.json b/common/changes/@visactor/vtable/5096-bug-drag-autofill-plugin-getorigincellvalue_2026-04-08-08-39.json new file mode 100644 index 0000000000..529ae0b0fa --- /dev/null +++ b/common/changes/@visactor/vtable/5096-bug-drag-autofill-plugin-getorigincellvalue_2026-04-08-08-39.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "fix: fill handle logic about get cell value #5096\n\n", + "type": "none", + "packageName": "@visactor/vtable" + } + ], + "packageName": "@visactor/vtable", + "email": "892739385@qq.com" +} \ No newline at end of file