mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-21 11:45:59 +00:00
perspective sort - divided by table
This commit is contained in:
@@ -7,9 +7,11 @@ export interface PerspectiveConfigColumns {
|
||||
export interface PerspectiveConfig extends PerspectiveConfigColumns {
|
||||
filters: { [uniqueName: string]: string };
|
||||
sort: {
|
||||
uniqueName: string;
|
||||
order: 'ASC' | 'DESC';
|
||||
}[];
|
||||
[parentUniqueName: string]: {
|
||||
uniqueName: string;
|
||||
order: 'ASC' | 'DESC';
|
||||
}[];
|
||||
};
|
||||
}
|
||||
|
||||
export function createPerspectiveConfig(): PerspectiveConfig {
|
||||
@@ -18,7 +20,7 @@ export function createPerspectiveConfig(): PerspectiveConfig {
|
||||
checkedColumns: [],
|
||||
uncheckedColumns: [],
|
||||
filters: {},
|
||||
sort: [],
|
||||
sort: {},
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -188,7 +188,7 @@ export abstract class PerspectiveTreeNode {
|
||||
getOrderBy(table: TableInfo): PerspectiveDataLoadProps['orderBy'] {
|
||||
const res = _compact(
|
||||
this.childNodes.map(node => {
|
||||
const sort = this.config?.sort?.find(x => x.uniqueName == node.uniqueName);
|
||||
const sort = this.config?.sort?.[node?.parentNode?.uniqueName]?.find(x => x.uniqueName == node.uniqueName);
|
||||
if (sort) {
|
||||
return {
|
||||
columnName: node.columnName,
|
||||
|
||||
Reference in New Issue
Block a user