|
|
|
@ -6,6 +6,10 @@ import type { Row } from '~/lib'
|
|
|
|
|
|
|
|
|
|
export const geodataToggleState = reactive({ show: false }) |
|
|
|
|
|
|
|
|
|
const reloadTrigger = inject(ReloadRowDataHookInj, createEventHook()) |
|
|
|
|
|
|
|
|
|
// const { project, isSharedBase } = useProject()
|
|
|
|
|
|
|
|
|
|
const formatData = (list: Row[]) => |
|
|
|
|
list.map((row) => ({ |
|
|
|
|
row: { ...row }, |
|
|
|
@ -13,9 +17,6 @@ const formatData = (list: Row[]) =>
|
|
|
|
|
rowMeta: {}, |
|
|
|
|
})) |
|
|
|
|
|
|
|
|
|
const appInfoDefaultLimit = 1000 |
|
|
|
|
const paginationData = ref<PaginatedType>({ page: 1, pageSize: appInfoDefaultLimit }) |
|
|
|
|
|
|
|
|
|
const [useProvideMapViewStore, useMapViewStore] = useInjectionState( |
|
|
|
|
( |
|
|
|
|
meta: Ref<TableType | undefined>, |
|
|
|
@ -36,7 +37,11 @@ const [useProvideMapViewStore, useMapViewStore] = useInjectionState(
|
|
|
|
|
|
|
|
|
|
const view = inject(ActiveViewInj) |
|
|
|
|
|
|
|
|
|
const { syncCount } = useViewData(meta, view!) |
|
|
|
|
// const { syncCount } = useViewData(meta, view!)
|
|
|
|
|
|
|
|
|
|
const appInfoDefaultLimit = 1000 |
|
|
|
|
|
|
|
|
|
const paginationData = ref<PaginatedType>({ page: 1, pageSize: appInfoDefaultLimit }) |
|
|
|
|
|
|
|
|
|
const queryParams = computed(() => ({ |
|
|
|
|
// offset: ((paginationData.value.page ?? 0) - 1) * (paginationData.value.pageSize ?? appInfoDefaultLimit),
|
|
|
|
@ -44,6 +49,16 @@ const [useProvideMapViewStore, useMapViewStore] = useInjectionState(
|
|
|
|
|
where: where?.value ?? '', |
|
|
|
|
})) |
|
|
|
|
|
|
|
|
|
async function syncCount() { |
|
|
|
|
const { count } = await $api.dbViewRow.count( |
|
|
|
|
NOCO, |
|
|
|
|
project?.value?.title as string, |
|
|
|
|
meta?.value?.id as string, |
|
|
|
|
viewMeta?.value?.id as string, |
|
|
|
|
) |
|
|
|
|
paginationData.value.totalRows = count |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async function loadMapMeta() { |
|
|
|
|
if (!viewMeta?.value?.id || !meta?.value?.columns) return |
|
|
|
|
mapMetaData.value = await $api.dbView.mapRead(viewMeta.value.id) |
|
|
|
@ -59,7 +74,7 @@ const [useProvideMapViewStore, useMapViewStore] = useInjectionState(
|
|
|
|
|
where: where?.value, |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
syncCount() |
|
|
|
|
// syncCount()
|
|
|
|
|
|
|
|
|
|
formattedData.value = formatData(res.list) |
|
|
|
|
} |
|
|
|
@ -139,6 +154,8 @@ const [useProvideMapViewStore, useMapViewStore] = useInjectionState(
|
|
|
|
|
addEmptyRow, |
|
|
|
|
insertRow, |
|
|
|
|
geodataToggleState, |
|
|
|
|
syncCount, |
|
|
|
|
paginationData, |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
) |
|
|
|
|