Skip to content

【BUG】dataTable截取tableData时计算错误,导致第n*countNumber+1项数据丢失 #226

Description

@zx69

dataTable中,第440行计算的virtualData为formData.table?.slice?.(0, (countNumber.value + 1) * maxLength) || [], 但884行判断下一项取的是formData.table[(countNumber.value + 1) * maxLength + 1], 多加了1, 导致第31行,61行,91行...即30*n+1行数据不会加载。例如:

let maxLength = 10; // 设maxLength为10
let arr = [0,1,2,3,4,5,6,7,8,9,10]; // 数组arr包含11项数据
let virtualData = arr.slice(0, maxLength); // virtualData截取了前10项数据[0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
let rest = arr[maxLength + 1]; // rest=arr[11]为undefined,
// rest为undefined,887行的countNumber++不会执行,导致后面的第n*countNumber+1不会加载, arr第11项数据10丢失了

请确认884行判断是否应该改成formData.table[(countNumber.value + 1) * maxLength].
该bug会影响所有使用dataTable的页面的数据完整性,希望能优先处理, 谢谢!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions