|
|
@ -13,14 +13,12 @@ const formatData = (list: Row[]) => |
|
|
|
rowMeta: {}, |
|
|
|
rowMeta: {}, |
|
|
|
})) |
|
|
|
})) |
|
|
|
|
|
|
|
|
|
|
|
const { appInfo } = $(useGlobal()) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const appInfoDefaultLimit = 1000 |
|
|
|
const appInfoDefaultLimit = 1000 |
|
|
|
const paginationData = ref<PaginatedType>({ page: 1, pageSize: appInfoDefaultLimit }) |
|
|
|
const paginationData = ref<PaginatedType>({ page: 1, pageSize: appInfoDefaultLimit }) |
|
|
|
|
|
|
|
|
|
|
|
const [useProvideMapViewStore, useMapViewStore] = useInjectionState( |
|
|
|
const [useProvideMapViewStore, useMapViewStore] = useInjectionState( |
|
|
|
( |
|
|
|
( |
|
|
|
meta: Ref<TableType | MapType | undefined>, |
|
|
|
meta: Ref<TableType | undefined>, |
|
|
|
viewMeta: Ref<ViewType | MapType | undefined> | ComputedRef<(ViewType & { id: string }) | undefined>, |
|
|
|
viewMeta: Ref<ViewType | MapType | undefined> | ComputedRef<(ViewType & { id: string }) | undefined>, |
|
|
|
where?: ComputedRef<string | undefined>, |
|
|
|
where?: ComputedRef<string | undefined>, |
|
|
|
) => { |
|
|
|
) => { |
|
|
@ -36,6 +34,10 @@ const [useProvideMapViewStore, useMapViewStore] = useInjectionState( |
|
|
|
|
|
|
|
|
|
|
|
const geoDataFieldColumn = ref<ColumnType | undefined>() |
|
|
|
const geoDataFieldColumn = ref<ColumnType | undefined>() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const view = inject(ActiveViewInj) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { syncCount } = useViewData(meta, view!) |
|
|
|
|
|
|
|
|
|
|
|
const queryParams = computed(() => ({ |
|
|
|
const queryParams = computed(() => ({ |
|
|
|
// offset: ((paginationData.value.page ?? 0) - 1) * (paginationData.value.pageSize ?? appInfoDefaultLimit),
|
|
|
|
// offset: ((paginationData.value.page ?? 0) - 1) * (paginationData.value.pageSize ?? appInfoDefaultLimit),
|
|
|
|
limit: paginationData.value.pageSize ?? appInfoDefaultLimit, |
|
|
|
limit: paginationData.value.pageSize ?? appInfoDefaultLimit, |
|
|
@ -54,12 +56,11 @@ const [useProvideMapViewStore, useMapViewStore] = useInjectionState( |
|
|
|
|
|
|
|
|
|
|
|
const res = await api.dbViewRow.list('noco', project.value.id!, meta.value!.id!, viewMeta.value!.id!, { |
|
|
|
const res = await api.dbViewRow.list('noco', project.value.id!, meta.value!.id!, viewMeta.value!.id!, { |
|
|
|
...queryParams.value, |
|
|
|
...queryParams.value, |
|
|
|
// ...params,
|
|
|
|
|
|
|
|
// ...(isUIAllowed('sortSync') ? {} : { sortArrJson: JSON.stringify(sorts.value) }),
|
|
|
|
|
|
|
|
// ...(isUIAllowed('filterSync') ? {} : { filterArrJson: JSON.stringify(nestedFilters.value) }),
|
|
|
|
|
|
|
|
where: where?.value, |
|
|
|
where: where?.value, |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
syncCount() |
|
|
|
|
|
|
|
|
|
|
|
formattedData.value = formatData(res.list) |
|
|
|
formattedData.value = formatData(res.list) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -108,6 +109,8 @@ const [useProvideMapViewStore, useMapViewStore] = useInjectionState( |
|
|
|
oldRow: { ...insertedData }, |
|
|
|
oldRow: { ...insertedData }, |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
syncCount() |
|
|
|
|
|
|
|
|
|
|
|
return insertedData |
|
|
|
return insertedData |
|
|
|
} catch (error: any) { |
|
|
|
} catch (error: any) { |
|
|
|
message.error(await extractSdkResponseErrorMsg(error)) |
|
|
|
message.error(await extractSdkResponseErrorMsg(error)) |
|
|
|