diff --git a/src/components/queryBuilder/BuilderHost.vue b/src/components/queryBuilder/BuilderHost.vue index 4d1c0a4..f2cb3e3 100644 --- a/src/components/queryBuilder/BuilderHost.vue +++ b/src/components/queryBuilder/BuilderHost.vue @@ -29,6 +29,13 @@ > +
+ +
@@ -40,7 +47,13 @@ import { defineComponent, type PropType } from "vue"; import { mapActions, mapState } from "pinia"; import type { DynamicQueryStructure } from "../../types/dynamicQueries"; -import { ArchiveBoxArrowDownIcon, InboxArrowDownIcon, NoSymbolIcon, PlayIcon } from "@heroicons/vue/24/outline"; +import { + ArchiveBoxArrowDownIcon, + InboxArrowDownIcon, + NoSymbolIcon, + PlayIcon, + TrashIcon, +} from "@heroicons/vue/24/outline"; import { useQueryBuilderStore } from "../../stores/admin/queryBuilder"; import Table from "./Table.vue"; diff --git a/src/components/queryBuilder/Condition.vue b/src/components/queryBuilder/Condition.vue index f686a9b..66c62d9 100644 --- a/src/components/queryBuilder/Condition.vue +++ b/src/components/queryBuilder/Condition.vue @@ -8,10 +8,17 @@ + +
@@ -21,7 +28,13 @@ @@ -50,6 +63,20 @@ export default defineComponent({ foreignColumns() { return this.activeTable?.relations.map((r) => r.column); }, + inputType() { + let type = this.activeTable?.columns.find((c) => c.column == this.column)?.type; + if (this.operation.includes("timespan")) return "number"; + switch (type) { + case "int": + return "number"; + case "varchar": + return "text"; + case "date": + return "date"; + default: + return "text"; + } + }, concat: { get() { return this.modelValue.concat; diff --git a/src/components/queryBuilder/NestedCondition.vue b/src/components/queryBuilder/NestedCondition.vue index 44cbb26..dde4d9c 100644 --- a/src/components/queryBuilder/NestedCondition.vue +++ b/src/components/queryBuilder/NestedCondition.vue @@ -1,6 +1,6 @@