VTable icon indicating copy to clipboard operation
VTable copied to clipboard

[Bug] 添加分页后,导出只能导出当前的表格页内容

Open chenbinedison opened this issue 9 months ago • 2 comments

Version

1.0

Link to Minimal Reproduction

[Bug] 添加分页后,导出只能导出当前的表格页内容

Steps to Reproduce

[Bug] 添加分页后,导出只能导出当前的表格页内容 分页代码 function createPagination(totalPages, currentPage) { if (document.getElementById('pagination-container')) { document.getElementById('pagination-container') .parentElement.removeChild(document.getElementById('pagination-container')); } // 创建一个style元素来添加CSS样式 const paginationContainer = document.createElement('div'); paginationContainer.id = 'pagination-container'; paginationContainer.style.position = "absolute"; paginationContainer.style.top = "calc(83% - 5px)"; paginationContainer.style.left = "10px"; container.parentElement.appendChild(paginationContainer);

    paginationContainer.innerHTML = '';
    // 创建一个无序列表作为分页的容器
    const ul = document.createElement('ul');
    ul.className = 'pagination';

    // 为每一页创建一个列表项
    for (let i = 1; i <= totalPages; i++) {
        // 创建列表项
        const li = document.createElement('li');
        // 创建链接
        const a = document.createElement('a');
        a.innerText = i;
        a.href = '?page=' + i;
        if(i===1){
            a.id=  'first-page-link';
        }
        a.className = i === currentPage ? 'active' : '';
        a.onclick = function (event) {
            event.preventDefault();
            let tempOption = {
                records: [],
                columns,
                widthMode: 'standard',
                autoFillWidth: true,
            }
            tableInstance = new VTable.ListTable(document.getElementById("tableContainer"), tempOption);
            setTimeout(() => {
                tableInstance = new VTable.ListTable(document.getElementById("tableContainer"), option);
                // 重新创建分页组件
                createPagination(totalPages, i);
                selectedPage = i;
                tableInstance.updatePagination({
                    currentPage: i - 1
                });
            }, 100)
        };
        li.appendChild(a);
        ul.appendChild(li); // 将列表项添加到无序列表中
    }
    paginationContainer.appendChild(ul); // 将分页组件添加到容器中

}

导出方法 async function exportExcel() { if (tableInstance) { console.log("导出tableInstance")

        downloadExcel(await exportVTableToExcel(tableInstance,option), 'TRB及时率');
    }
}

Current Behavior

希望分页后,能够导出全部数据

Expected Behavior

[Bug] 添加分页后,导出只能导出当前的表格页内容

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

chenbinedison avatar Apr 10 '25 09:04 chenbinedison

hello 这个问题有进展吗 多谢

chenbinedison avatar Apr 15 '25 05:04 chenbinedison

@Rui-Sun @creasy2010 有空麻烦帮忙看一下哈

chenbinedison avatar Apr 15 '25 05:04 chenbinedison

我来认领这个bug^_^

xiaozisong avatar May 07 '25 01:05 xiaozisong