diff --git a/client/src/stores/project/tables/table.store.ts b/client/src/stores/project/tables/table.store.ts index 3c065d6..3eea548 100644 --- a/client/src/stores/project/tables/table.store.ts +++ b/client/src/stores/project/tables/table.store.ts @@ -17,7 +17,9 @@ export const useTableStore = defineStore({ if (alreadyProject) { return alreadyProject } - const result = (await ApiService.post<{table_schema: any} | undefined>('/api/project/tables/main/schema/download', + const result = (await ApiService.post<{ + table_schema: any + } | undefined>('/api/project/tables/main/schema/download', { project: project, } @@ -43,11 +45,16 @@ export const useTableStore = defineStore({ key: string, order: 'ask' | 'desc' }[] | undefined = undefined, - filter: { - key: string | undefined, - value: string | undefined, - like: boolean | undefined - } | undefined = undefined + filters: { + key: string, + value?: string | number | boolean | undefined, + operator: string + }[] | undefined = undefined, + joins: { + table: string + pseudo?: string + condition: string + }[] | undefined = undefined ) { return await ApiService.post('/api/project/tables/list/load', { @@ -57,7 +64,8 @@ export const useTableStore = defineStore({ page: page - 1, count: count, order_by: orderBy, - filter: filter?.key ? filter : undefined + filter: filters, + joins: joins } ) }, @@ -65,18 +73,38 @@ export const useTableStore = defineStore({ project: string, table: string, columns: string[], - filter: { - key: string | undefined, - value: string | undefined, - like: boolean | undefined - } | undefined = undefined + filters: { + key: string, + value?: string | number | boolean | undefined, + operator: string + }[] | undefined = undefined, + joins: { + table: string + pseudo?: string + condition: string + }[] | undefined = undefined ) { return await ApiService.post<{ count: number }>('/api/project/tables/list/count', { project: project, table: table, columns: columns, - filter: filter?.key ? filter : undefined + filter: filters, + joins: joins + } + ) + }, + async fetchColumns( + project: string, + table: string + ) { + return await ApiService.post<{ + column_name: string, + data_type: string + }[]>('/api/project/tables/list/fetch_columns', + { + project: project, + table: table, } ) }, diff --git a/client/src/views/Project/Tables/Components/Element/DateSchemaComponent.vue b/client/src/views/Project/Tables/Components/Element/DateSchemaComponent.vue index d09c3ce..2d5309d 100644 --- a/client/src/views/Project/Tables/Components/Element/DateSchemaComponent.vue +++ b/client/src/views/Project/Tables/Components/Element/DateSchemaComponent.vue @@ -15,11 +15,6 @@ export default defineComponent({ required: true } }, - data() { - return { - on: false - } - }, watch: { model(newVal) { this.doWrite(newVal) diff --git a/client/src/views/Project/Tables/Components/Element/ImageSchemaComponent.vue b/client/src/views/Project/Tables/Components/Element/ImageSchemaComponent.vue index 3fa6c52..d92d793 100644 --- a/client/src/views/Project/Tables/Components/Element/ImageSchemaComponent.vue +++ b/client/src/views/Project/Tables/Components/Element/ImageSchemaComponent.vue @@ -24,7 +24,7 @@ export default defineComponent({ reader.readAsDataURL(file) reader.onload = () => { const bytes = reader?.result?.split(',')[1] - this.doWrite(bytes) + this.doWrite({type: 'bytes', value: bytes}) } } } @@ -38,7 +38,12 @@ export default defineComponent({ @update:model-value="doWriteFile" /> + diff --git a/client/src/views/Project/Tables/Components/Group/ListSchemaComponent.vue b/client/src/views/Project/Tables/Components/Group/ListSchemaComponent.vue index 4875add..2a9a821 100644 --- a/client/src/views/Project/Tables/Components/Group/ListSchemaComponent.vue +++ b/client/src/views/Project/Tables/Components/Group/ListSchemaComponent.vue @@ -1,15 +1,15 @@