|
|
@ -1,5 +1,5 @@ |
|
|
|
import { UITypes } from 'nocodb-sdk' |
|
|
|
|
|
|
|
import type { ColumnType, LinkToAnotherRecordType, LookupType, SelectOptionsType, TableType, ViewType } from 'nocodb-sdk' |
|
|
|
import type { ColumnType, LinkToAnotherRecordType, LookupType, SelectOptionsType, TableType, ViewType } from 'nocodb-sdk' |
|
|
|
|
|
|
|
import { UITypes } from 'nocodb-sdk' |
|
|
|
import type { Ref } from 'vue' |
|
|
|
import type { Ref } from 'vue' |
|
|
|
import { message } from 'ant-design-vue' |
|
|
|
import { message } from 'ant-design-vue' |
|
|
|
|
|
|
|
|
|
|
@ -207,6 +207,18 @@ const [useProvideViewGroupBy, useViewGroupBy] = useInjectionState( |
|
|
|
}, existing) |
|
|
|
}, existing) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const getSortParams = (sort: string) => { |
|
|
|
|
|
|
|
if (sort === 'asc') { |
|
|
|
|
|
|
|
return '+' |
|
|
|
|
|
|
|
} else if (sort === 'desc') { |
|
|
|
|
|
|
|
return '-' |
|
|
|
|
|
|
|
} else if (sort === 'count-asc') { |
|
|
|
|
|
|
|
return '~+' |
|
|
|
|
|
|
|
} else if (sort === 'count-desc') { |
|
|
|
|
|
|
|
return '~-' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async function loadGroups(params: any = {}, group?: Group) { |
|
|
|
async function loadGroups(params: any = {}, group?: Group) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
group = group || rootGroup.value |
|
|
|
group = group || rootGroup.value |
|
|
@ -246,7 +258,7 @@ const [useProvideViewGroupBy, useViewGroupBy] = useInjectionState( |
|
|
|
...(isUIAllowed('sortSync') ? {} : { sortArrJson: JSON.stringify(sorts.value) }), |
|
|
|
...(isUIAllowed('sortSync') ? {} : { sortArrJson: JSON.stringify(sorts.value) }), |
|
|
|
...(isUIAllowed('filterSync') ? {} : { filterArrJson: JSON.stringify(nestedFilters.value) }), |
|
|
|
...(isUIAllowed('filterSync') ? {} : { filterArrJson: JSON.stringify(nestedFilters.value) }), |
|
|
|
where: `${nestedWhere}`, |
|
|
|
where: `${nestedWhere}`, |
|
|
|
sort: `${groupby.sort === 'desc' ? '-' : ''}${groupby.column.title}`, |
|
|
|
sort: `${getSortParams(groupby.sort)}${groupby.column.title}`, |
|
|
|
column_name: groupby.column.title, |
|
|
|
column_name: groupby.column.title, |
|
|
|
} as any) |
|
|
|
} as any) |
|
|
|
: await api.public.dataGroupBy( |
|
|
|
: await api.public.dataGroupBy( |
|
|
@ -256,7 +268,7 @@ const [useProvideViewGroupBy, useViewGroupBy] = useInjectionState( |
|
|
|
limit: group.paginationData.pageSize ?? groupByGroupLimit.value, |
|
|
|
limit: group.paginationData.pageSize ?? groupByGroupLimit.value, |
|
|
|
...params, |
|
|
|
...params, |
|
|
|
where: nestedWhere, |
|
|
|
where: nestedWhere, |
|
|
|
sort: `${groupby.sort === 'desc' ? '-' : ''}${groupby.column.title}`, |
|
|
|
sort: `${getSortParams(groupby.sort)}${groupby.column.title}`, |
|
|
|
column_name: groupby.column.title, |
|
|
|
column_name: groupby.column.title, |
|
|
|
sortsArr: sorts.value, |
|
|
|
sortsArr: sorts.value, |
|
|
|
filtersArr: nestedFilters.value, |
|
|
|
filtersArr: nestedFilters.value, |
|
|
|