mirror of
https://github.com/dataease/dataease.git
synced 2026-05-19 02:08:10 +08:00
feat:过滤条件优化
This commit is contained in:
@@ -762,8 +762,10 @@ export default {
|
||||
filter_le: 'Less than or equal to',
|
||||
filter_gt: 'Greater than',
|
||||
filter_ge: 'Greater than or equal to',
|
||||
filter_null: 'Empty',
|
||||
filter_not_null: 'Not Empty',
|
||||
filter_null: 'Null',
|
||||
filter_not_null: 'Not Null',
|
||||
filter_empty: 'Empty String',
|
||||
filter_not_empty: 'Not Empty String',
|
||||
filter_include: 'Contain',
|
||||
filter_not_include: 'Not Contain',
|
||||
rose_type: 'Rose pattern',
|
||||
|
||||
@@ -763,8 +763,10 @@ export default {
|
||||
filter_le: '小于等于',
|
||||
filter_gt: '大于',
|
||||
filter_ge: '大于等于',
|
||||
filter_null: '爲空',
|
||||
filter_not_null: '不爲空',
|
||||
filter_null: '為空',
|
||||
filter_not_null: '不為空',
|
||||
filter_empty: '空字符串',
|
||||
filter_not_empty: '非空字符串',
|
||||
filter_include: '包含',
|
||||
filter_not_include: '不包含',
|
||||
rose_type: '玫瑰圖模式',
|
||||
|
||||
@@ -765,6 +765,8 @@ export default {
|
||||
filter_ge: '大于等于',
|
||||
filter_null: '为空',
|
||||
filter_not_null: '不为空',
|
||||
filter_empty: '空字符串',
|
||||
filter_not_empty: '非空字符串',
|
||||
filter_include: '包含',
|
||||
filter_not_include: '不包含',
|
||||
rose_type: '玫瑰图模式',
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-input v-show="!f.term.includes('null')" v-model="f.value" class="value-item" :placeholder="$t('chart.condition')" size="mini" clearable />
|
||||
<el-input v-show="!f.term.includes('null') && !f.term.includes('empty')" v-model="f.value" class="value-item" :placeholder="$t('chart.condition')" size="mini" clearable />
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-button type="text" icon="el-icon-delete" circle style="float: right" @click="removeFilter(index)" />
|
||||
@@ -44,56 +44,48 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
options: [{
|
||||
label: '',
|
||||
options: [{
|
||||
value: 'eq',
|
||||
label: this.$t('chart.filter_eq')
|
||||
}, {
|
||||
value: 'not_eq',
|
||||
label: this.$t('chart.filter_not_eq')
|
||||
}]
|
||||
},
|
||||
{
|
||||
label: '',
|
||||
options: [{
|
||||
value: 'like',
|
||||
label: this.$t('chart.filter_like')
|
||||
}, {
|
||||
value: 'not like',
|
||||
label: this.$t('chart.filter_not_like')
|
||||
}]
|
||||
},
|
||||
// {
|
||||
// label: '',
|
||||
// options: [{
|
||||
// value: 'lt',
|
||||
// label: this.$t('chart.filter_lt')
|
||||
// }, {
|
||||
// value: 'gt',
|
||||
// label: this.$t('chart.filter_gt')
|
||||
// }]
|
||||
// },
|
||||
// {
|
||||
// label: '',
|
||||
// options: [{
|
||||
// value: 'le',
|
||||
// label: this.$t('chart.filter_le')
|
||||
// }, {
|
||||
// value: 'ge',
|
||||
// label: this.$t('chart.filter_ge')
|
||||
// }]
|
||||
// },
|
||||
{
|
||||
label: '',
|
||||
options: [{
|
||||
value: 'null',
|
||||
label: this.$t('chart.filter_null')
|
||||
}, {
|
||||
value: 'not_null',
|
||||
label: this.$t('chart.filter_not_null')
|
||||
}]
|
||||
}]
|
||||
options: [
|
||||
{
|
||||
label: '',
|
||||
options: [{
|
||||
value: 'eq',
|
||||
label: this.$t('chart.filter_eq')
|
||||
}, {
|
||||
value: 'not_eq',
|
||||
label: this.$t('chart.filter_not_eq')
|
||||
}]
|
||||
},
|
||||
{
|
||||
label: '',
|
||||
options: [{
|
||||
value: 'like',
|
||||
label: this.$t('chart.filter_like')
|
||||
}, {
|
||||
value: 'not like',
|
||||
label: this.$t('chart.filter_not_like')
|
||||
}]
|
||||
},
|
||||
{
|
||||
label: '',
|
||||
options: [{
|
||||
value: 'null',
|
||||
label: this.$t('chart.filter_null')
|
||||
}, {
|
||||
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')
|
||||
}]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -113,7 +105,7 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.filter-item{
|
||||
.filter-item {
|
||||
width: 100%;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #DCDFE6;
|
||||
@@ -123,19 +115,22 @@ export default {
|
||||
justify-content: left;
|
||||
align-items: center;
|
||||
}
|
||||
.form-item>>>.el-form-item__label{
|
||||
|
||||
.form-item >>> .el-form-item__label {
|
||||
font-size: 12px;
|
||||
}
|
||||
span{
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.value-item>>>.el-input{
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 80px!important;
|
||||
}
|
||||
.el-select-dropdown__item{
|
||||
span {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.value-item >>> .el-input {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 80px !important;
|
||||
}
|
||||
|
||||
.el-select-dropdown__item {
|
||||
padding: 0 20px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
@@ -83,16 +83,6 @@ export default {
|
||||
value: 'ge',
|
||||
label: this.$t('chart.filter_ge')
|
||||
}]
|
||||
},
|
||||
{
|
||||
label: '',
|
||||
options: [{
|
||||
value: 'null',
|
||||
label: this.$t('chart.filter_null')
|
||||
}, {
|
||||
value: 'not_null',
|
||||
label: this.$t('chart.filter_not_null')
|
||||
}]
|
||||
}]
|
||||
}
|
||||
},
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-input v-show="!f.term.includes('null')" v-model="f.value" class="value-item" :placeholder="$t('chart.condition')" size="mini" clearable />
|
||||
<el-input v-show="!f.term.includes('null') && !f.term.includes('empty')" v-model="f.value" class="value-item" :placeholder="$t('chart.condition')" size="mini" clearable />
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-button type="text" icon="el-icon-delete" circle style="float: right" @click="removeFilter(index)" />
|
||||
@@ -80,6 +80,16 @@ 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: [
|
||||
@@ -112,16 +122,6 @@ export default {
|
||||
value: 'ge',
|
||||
label: this.$t('chart.filter_ge')
|
||||
}]
|
||||
},
|
||||
{
|
||||
label: '',
|
||||
options: [{
|
||||
value: 'null',
|
||||
label: this.$t('chart.filter_null')
|
||||
}, {
|
||||
value: 'not_null',
|
||||
label: this.$t('chart.filter_not_null')
|
||||
}]
|
||||
}
|
||||
],
|
||||
valueOptions: [
|
||||
@@ -154,16 +154,6 @@ export default {
|
||||
value: 'ge',
|
||||
label: this.$t('chart.filter_ge')
|
||||
}]
|
||||
},
|
||||
{
|
||||
label: '',
|
||||
options: [{
|
||||
value: 'null',
|
||||
label: this.$t('chart.filter_null')
|
||||
}, {
|
||||
value: 'not_null',
|
||||
label: this.$t('chart.filter_not_null')
|
||||
}]
|
||||
}
|
||||
],
|
||||
options: []
|
||||
|
||||
@@ -1201,7 +1201,7 @@ export default {
|
||||
saveDimensionFilter() {
|
||||
for (let i = 0; i < this.dimensionItem.filter.length; i++) {
|
||||
const f = this.dimensionItem.filter[i]
|
||||
if (!f.term.includes('null') && (!f.value || f.value === '')) {
|
||||
if (!f.term.includes('null') && !f.term.includes('empty') && (!f.value || f.value === '')) {
|
||||
this.$message({
|
||||
message: this.$t('chart.filter_value_can_null'),
|
||||
type: 'error',
|
||||
@@ -1225,7 +1225,7 @@ export default {
|
||||
saveQuotaFilter() {
|
||||
for (let i = 0; i < this.quotaItem.filter.length; i++) {
|
||||
const f = this.quotaItem.filter[i]
|
||||
if (!f.term.includes('null') && (!f.value || f.value === '')) {
|
||||
if (!f.term.includes('null') && !f.term.includes('empty') && (!f.value || f.value === '')) {
|
||||
this.$message({
|
||||
message: this.$t('chart.filter_value_can_null'),
|
||||
type: 'error',
|
||||
@@ -1258,7 +1258,7 @@ export default {
|
||||
saveResultFilter() {
|
||||
for (let i = 0; i < this.filterItem.filter.length; i++) {
|
||||
const f = this.filterItem.filter[i]
|
||||
if (!f.term.includes('null') && (!f.value || f.value === '')) {
|
||||
if (!f.term.includes('null') && !f.term.includes('empty') && (!f.value || f.value === '')) {
|
||||
this.$message({
|
||||
message: this.$t('chart.filter_value_can_null'),
|
||||
type: 'error',
|
||||
|
||||
Reference in New Issue
Block a user