From 1f8349f8d0e53233e169e48e80cd61a28fa86d87 Mon Sep 17 00:00:00 2001 From: Julian Krauser Date: Mon, 16 Dec 2024 15:39:49 +0100 Subject: [PATCH] Condition and order building --- src/components/queryBuilder/Condition.vue | 87 +++++++++++++++++ src/components/queryBuilder/Join.vue | 13 ++- .../queryBuilder/NestedCondition.vue | 64 +++++++++++++ src/components/queryBuilder/NestedWhere.vue | 93 +++++++++++++++++++ src/components/queryBuilder/Order.vue | 41 +++++++- .../queryBuilder/OrderStructure.vue | 79 ++++++++++++++++ src/components/queryBuilder/Table.vue | 4 +- src/components/queryBuilder/Where.vue | 66 +++++++++++-- src/types/dynamicQueries.ts | 1 + 9 files changed, 433 insertions(+), 15 deletions(-) create mode 100644 src/components/queryBuilder/Condition.vue create mode 100644 src/components/queryBuilder/NestedCondition.vue create mode 100644 src/components/queryBuilder/NestedWhere.vue create mode 100644 src/components/queryBuilder/OrderStructure.vue diff --git a/src/components/queryBuilder/Condition.vue b/src/components/queryBuilder/Condition.vue new file mode 100644 index 0000000..f686a9b --- /dev/null +++ b/src/components/queryBuilder/Condition.vue @@ -0,0 +1,87 @@ + + + + + diff --git a/src/components/queryBuilder/Join.vue b/src/components/queryBuilder/Join.vue index 1c5c3c1..d6890f9 100644 --- a/src/components/queryBuilder/Join.vue +++ b/src/components/queryBuilder/Join.vue @@ -1,7 +1,13 @@ @@ -10,6 +16,7 @@ import { defineComponent, type PropType } from "vue"; import { mapActions, mapState } from "pinia"; import type { DynamicQueryStructure } from "../../types/dynamicQueries"; import { useQueryBuilderStore } from "../../stores/admin/queryBuilder"; +import { PlusIcon } from "@heroicons/vue/24/outline"; + + diff --git a/src/components/queryBuilder/NestedWhere.vue b/src/components/queryBuilder/NestedWhere.vue new file mode 100644 index 0000000..023c035 --- /dev/null +++ b/src/components/queryBuilder/NestedWhere.vue @@ -0,0 +1,93 @@ + + + + + diff --git a/src/components/queryBuilder/Order.vue b/src/components/queryBuilder/Order.vue index f664809..99ec7cc 100644 --- a/src/components/queryBuilder/Order.vue +++ b/src/components/queryBuilder/Order.vue @@ -1,6 +1,21 @@ @@ -9,6 +24,8 @@ import { defineComponent, type PropType } from "vue"; import { mapActions, mapState } from "pinia"; import type { OrderByStructure } from "../../types/dynamicQueries"; import { useQueryBuilderStore } from "../../stores/admin/queryBuilder"; +import OrderStructure from "./OrderStructure.vue"; +import { PlusIcon } from "@heroicons/vue/24/outline"; + + diff --git a/src/components/queryBuilder/Table.vue b/src/components/queryBuilder/Table.vue index 9e4eba6..d973a33 100644 --- a/src/components/queryBuilder/Table.vue +++ b/src/components/queryBuilder/Table.vue @@ -2,9 +2,9 @@
- + - +
diff --git a/src/components/queryBuilder/Where.vue b/src/components/queryBuilder/Where.vue index 2b4332a..ddc2e9f 100644 --- a/src/components/queryBuilder/Where.vue +++ b/src/components/queryBuilder/Where.vue @@ -1,6 +1,32 @@ @@ -9,6 +35,9 @@ import { defineComponent, type PropType } from "vue"; import { mapActions, mapState } from "pinia"; import type { ConditionStructure } from "../../types/dynamicQueries"; import { useQueryBuilderStore } from "../../stores/admin/queryBuilder"; +import NestedCondition from "./NestedCondition.vue"; +import Condition from "./Condition.vue"; +import { PlusIcon, RectangleStackIcon } from "@heroicons/vue/24/outline"; diff --git a/src/types/dynamicQueries.ts b/src/types/dynamicQueries.ts index 2e3bc06..460b158 100644 --- a/src/types/dynamicQueries.ts +++ b/src/types/dynamicQueries.ts @@ -44,6 +44,7 @@ export type WhereOperation = | "between" // Is between | "startsWith" // Starts with | "endsWith"; // Ends with +// TODO: age between | age equals | age greater | age smaller export type OrderByStructure = { column: string;