Browse Source

feat(nc-gui): add fetchSharedViewGroupedData

pull/3563/head
Wing-Kam Wong 2 years ago
parent
commit
f6e103ad37
  1. 26
      packages/nc-gui/composables/useSharedView.ts

26
packages/nc-gui/composables/useSharedView.ts

@ -88,6 +88,31 @@ export function useSharedView() {
return data return data
} }
const fetchSharedViewGroupedData = async (columnId: string, params: Parameters<Api<any>['dbViewRow']['list']>[4] = {}) => {
if (!sharedView.value) return
const page = paginationData.value.page || 1
const pageSize = paginationData.value.pageSize || appInfoDefaultLimit
const data = await $api.public.groupedDataList(
sharedView.value.uuid!,
columnId,
{
offset: (page - 1) * pageSize,
filterArrJson: JSON.stringify(nestedFilters.value),
sortArrJson: JSON.stringify(sorts.value),
...params,
} as any,
{
headers: {
'xc-password': password.value,
},
},
)
console.log(data)
return data
}
const exportFile = async ( const exportFile = async (
fields: any[], fields: any[],
offset: number, offset: number,
@ -115,6 +140,7 @@ export function useSharedView() {
meta, meta,
nestedFilters, nestedFilters,
fetchSharedViewData, fetchSharedViewData,
fetchSharedViewGroupedData,
paginationData, paginationData,
sorts, sorts,
exportFile, exportFile,

Loading…
Cancel
Save