refactor(视图): 表格阈值null与空字符串合并成一个条件

This commit is contained in:
junjun 2022-07-28 22:16:37 +08:00
parent c07b4326e3
commit e83687c9e7
2 changed files with 3 additions and 23 deletions

View File

@ -541,7 +541,7 @@ function mappingColor(value, defaultColor, field, type) {
} else if (i === field.conditions.length - 1) {
color = defaultColor
}
} else if (field.field.deType === 0) {
} else if (field.field.deType === 0 || field.field.deType === 5) {
const tv = t.value
if (t.term === 'eq') {
if (value === tv) {
@ -564,22 +564,12 @@ function mappingColor(value, defaultColor, field, type) {
flag = true
}
} else if (t.term === 'null') {
if (value === null || value === undefined) {
if (value === null || value === undefined || value === '') {
color = t[type]
flag = true
}
} else if (t.term === 'not_null') {
if (value !== null && value !== undefined) {
color = t[type]
flag = true
}
} else if (t.term === 'empty') {
if (value === '') {
color = t[type]
flag = true
}
} else if (t.term === 'not_empty') {
if (value !== '') {
if (value !== null && value !== undefined && value !== '') {
color = t[type]
flag = true
}

View File

@ -166,16 +166,6 @@ export default {
value: 'not_null',
label: this.$t('chart.filter_not_null')
}]
},
{
label: '',
options: [{
value: 'empty',
label: this.$t('chart.filter_empty')
}, {
value: 'not_empty',
label: this.$t('chart.filter_not_empty')
}]
}
],
dateOptions: [