mirror of https://github.com/Fabio286/antares.git
feat: add NOT LIKE to table filters, closes #672
This commit is contained in:
parent
98c1f43a4d
commit
9c66fd51cb
|
@ -21,10 +21,12 @@ export interface TableDeleteParams {
|
||||||
rows: {[key: string]: any};
|
rows: {[key: string]: any};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type TableFilterOperator = '=' | '!=' | '>' | '<' | '>=' | '<=' | 'IN' | 'NOT IN' | 'LIKE' | 'NOT LIKE' | 'BETWEEN' | 'IS NULL' | 'IS NOT NULL'
|
||||||
|
|
||||||
export interface TableFilterClausole {
|
export interface TableFilterClausole {
|
||||||
active: boolean;
|
active: boolean;
|
||||||
field: string;
|
field: string;
|
||||||
op: '=' | '!=' | '>' | '<' | '>=' | '<=' | 'IN' | 'NOT IN' | 'LIKE' | 'BETWEEN' | 'IS NULL' | 'IS NOT NULL';
|
op:TableFilterOperator;
|
||||||
value: '';
|
value: '';
|
||||||
value2: '';
|
value2: '';
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,7 +76,7 @@
|
||||||
import customizations from 'common/customizations';
|
import customizations from 'common/customizations';
|
||||||
import { FLOAT, NUMBER } from 'common/fieldTypes';
|
import { FLOAT, NUMBER } from 'common/fieldTypes';
|
||||||
import { ClientCode, TableField } from 'common/interfaces/antares';
|
import { ClientCode, TableField } from 'common/interfaces/antares';
|
||||||
import { TableFilterClausole } from 'common/interfaces/tableApis';
|
import { TableFilterClausole, TableFilterOperator } from 'common/interfaces/tableApis';
|
||||||
import { computed, Prop, ref } from 'vue';
|
import { computed, Prop, ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
|
@ -93,8 +93,8 @@ const props = defineProps({
|
||||||
const emit = defineEmits(['filter-change', 'filter']);
|
const emit = defineEmits(['filter-change', 'filter']);
|
||||||
|
|
||||||
const rows = ref([]);
|
const rows = ref([]);
|
||||||
const operators = ref([
|
const operators = ref<TableFilterOperator[]>([
|
||||||
'=', '!=', '>', '<', '>=', '<=', 'IN', 'NOT IN', 'LIKE', 'BETWEEN', 'IS NULL', 'IS NOT NULL'
|
'=', '!=', '>', '<', '>=', '<=', 'IN', 'NOT IN', 'LIKE', 'NOT LIKE', 'BETWEEN', 'IS NULL', 'IS NOT NULL'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const clientCustomizations = computed(() => customizations[props.connClient]);
|
const clientCustomizations = computed(() => customizations[props.connClient]);
|
||||||
|
@ -152,6 +152,7 @@ const createClausole = (filter: TableFilterClausole) => {
|
||||||
value = '';
|
value = '';
|
||||||
break;
|
break;
|
||||||
case 'LIKE':
|
case 'LIKE':
|
||||||
|
case 'NOT LIKE':
|
||||||
value = `${sw}%${filter.value}%${sw}`;
|
value = `${sw}%${filter.value}%${sw}`;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in New Issue