diff --git a/src/common/interfaces/tableApis.ts b/src/common/interfaces/tableApis.ts index 1b008a99..c406770b 100644 --- a/src/common/interfaces/tableApis.ts +++ b/src/common/interfaces/tableApis.ts @@ -21,10 +21,12 @@ export interface TableDeleteParams { rows: {[key: string]: any}; } +export type TableFilterOperator = '=' | '!=' | '>' | '<' | '>=' | '<=' | 'IN' | 'NOT IN' | 'LIKE' | 'NOT LIKE' | 'BETWEEN' | 'IS NULL' | 'IS NOT NULL' + export interface TableFilterClausole { active: boolean; field: string; - op: '=' | '!=' | '>' | '<' | '>=' | '<=' | 'IN' | 'NOT IN' | 'LIKE' | 'BETWEEN' | 'IS NULL' | 'IS NOT NULL'; + op:TableFilterOperator; value: ''; value2: ''; } diff --git a/src/renderer/components/WorkspaceTabTableFilters.vue b/src/renderer/components/WorkspaceTabTableFilters.vue index 7173a0e2..de89c92d 100644 --- a/src/renderer/components/WorkspaceTabTableFilters.vue +++ b/src/renderer/components/WorkspaceTabTableFilters.vue @@ -76,7 +76,7 @@ import customizations from 'common/customizations'; import { FLOAT, NUMBER } from 'common/fieldTypes'; 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 { useI18n } from 'vue-i18n'; @@ -93,8 +93,8 @@ const props = defineProps({ const emit = defineEmits(['filter-change', 'filter']); const rows = ref([]); -const operators = ref([ - '=', '!=', '>', '<', '>=', '<=', 'IN', 'NOT IN', 'LIKE', 'BETWEEN', 'IS NULL', 'IS NOT NULL' +const operators = ref([ + '=', '!=', '>', '<', '>=', '<=', 'IN', 'NOT IN', 'LIKE', 'NOT LIKE', 'BETWEEN', 'IS NULL', 'IS NOT NULL' ]); const clientCustomizations = computed(() => customizations[props.connClient]); @@ -152,6 +152,7 @@ const createClausole = (filter: TableFilterClausole) => { value = ''; break; case 'LIKE': + case 'NOT LIKE': value = `${sw}%${filter.value}%${sw}`; break; default: