Merge pull request #5804 from dataease/pr@dev@fix_table_empty_strategy

fix(视图-表格): 空值过滤时隐藏空值异常
This commit is contained in:
wisonic-s 2023-07-31 22:04:57 +08:00 committed by GitHub
commit 08e68444c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3710,7 +3710,7 @@ export function handleTableEmptyStrategy(tableData, chart) {
} }
if (intersection.length) { if (intersection.length) {
newData = _.clone(tableData) newData = _.clone(tableData)
for (let i = 0; i < newData.length; i++) { for (let i = newData.length - 1; i >= 0; i--) {
for (let j = 0, tmp = intersection.length; j < tmp; j++) { for (let j = 0, tmp = intersection.length; j < tmp; j++) {
const deName = intersection[j] const deName = intersection[j]
if (newData[i][deName] === null) { if (newData[i][deName] === null) {
@ -3719,6 +3719,7 @@ export function handleTableEmptyStrategy(tableData, chart) {
} }
if (emptyDataStrategy === 'ignoreData') { if (emptyDataStrategy === 'ignoreData') {
newData = _.filter(newData, (_, index) => index !== i) newData = _.filter(newData, (_, index) => index !== i)
break
} }
} }
} }