mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-30 17:26:53 +00:00
geodata: switch info about record limits depending on the size of data in map view
This commit is contained in:
@@ -13,14 +13,12 @@ const formatData = (list: Row[]) =>
|
||||
rowMeta: {},
|
||||
}))
|
||||
|
||||
const { appInfo } = $(useGlobal())
|
||||
|
||||
const appInfoDefaultLimit = 1000
|
||||
const paginationData = ref<PaginatedType>({ page: 1, pageSize: appInfoDefaultLimit })
|
||||
|
||||
const [useProvideMapViewStore, useMapViewStore] = useInjectionState(
|
||||
(
|
||||
meta: Ref<TableType | MapType | undefined>,
|
||||
meta: Ref<TableType | undefined>,
|
||||
viewMeta: Ref<ViewType | MapType | undefined> | ComputedRef<(ViewType & { id: string }) | undefined>,
|
||||
where?: ComputedRef<string | undefined>,
|
||||
) => {
|
||||
@@ -36,6 +34,10 @@ const [useProvideMapViewStore, useMapViewStore] = useInjectionState(
|
||||
|
||||
const geoDataFieldColumn = ref<ColumnType | undefined>()
|
||||
|
||||
const view = inject(ActiveViewInj)
|
||||
|
||||
const { syncCount } = useViewData(meta, view!)
|
||||
|
||||
const queryParams = computed(() => ({
|
||||
// offset: ((paginationData.value.page ?? 0) - 1) * (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!, {
|
||||
...queryParams.value,
|
||||
// ...params,
|
||||
// ...(isUIAllowed('sortSync') ? {} : { sortArrJson: JSON.stringify(sorts.value) }),
|
||||
// ...(isUIAllowed('filterSync') ? {} : { filterArrJson: JSON.stringify(nestedFilters.value) }),
|
||||
where: where?.value,
|
||||
})
|
||||
|
||||
syncCount()
|
||||
|
||||
formattedData.value = formatData(res.list)
|
||||
}
|
||||
|
||||
@@ -108,6 +109,8 @@ const [useProvideMapViewStore, useMapViewStore] = useInjectionState(
|
||||
oldRow: { ...insertedData },
|
||||
})
|
||||
|
||||
syncCount()
|
||||
|
||||
return insertedData
|
||||
} catch (error: any) {
|
||||
message.error(await extractSdkResponseErrorMsg(error))
|
||||
|
||||
Reference in New Issue
Block a user