mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-30 20:53:57 +00:00
find also in related columns
This commit is contained in:
@@ -115,6 +115,10 @@ export abstract class GridDisplay {
|
|||||||
return this.getColumns(null).filter(col => col.isChecked || col.uniquePath.length == 1);
|
return this.getColumns(null).filter(col => col.isChecked || col.uniquePath.length == 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getFkTarget(column: DisplayColumn): TableInfo {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
reload() {
|
reload() {
|
||||||
this.setCache(reloadDataCacheFunc);
|
this.setCache(reloadDataCacheFunc);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -453,13 +453,37 @@
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
for (const column of display.columns) {
|
||||||
|
if (column.uniquePath.length > 1) continue;
|
||||||
|
if (column.isExpandable) {
|
||||||
|
const table = display.getFkTarget(column);
|
||||||
|
if (!table) continue;
|
||||||
|
|
||||||
|
for (const childColumn of table.columns) {
|
||||||
|
res.push({
|
||||||
|
text: `${column.columnName}.${childColumn.columnName}`,
|
||||||
|
onClick: async () => {
|
||||||
|
const uniquePath = [...column.uniquePath, childColumn.columnName];
|
||||||
|
display.setColumnVisibility(uniquePath, true);
|
||||||
|
display.toggleExpandedColumn(column.uniqueName, true);
|
||||||
|
await tick();
|
||||||
|
const invMap = _.invert(realColumnUniqueNames);
|
||||||
|
const colIndex = invMap[uniquePath.join('.')];
|
||||||
|
scrollIntoView([null, colIndex]);
|
||||||
|
|
||||||
|
currentCell = [currentCell[0], parseInt(colIndex)];
|
||||||
|
selectedCells = [currentCell];
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function hideColumn() {
|
export function hideColumn() {
|
||||||
const columnIndexes = _.uniq(selectedCells.map(x => x[1]));
|
const columnIndexes = _.uniq(selectedCells.map(x => x[1]));
|
||||||
for (const index of columnIndexes) {
|
for (const index of columnIndexes) {
|
||||||
console.log('visibleRealColumns[index].uniquePath', visibleRealColumns[index].uniquePath);
|
|
||||||
display.setColumnVisibility(visibleRealColumns[index].uniquePath, false);
|
display.setColumnVisibility(visibleRealColumns[index].uniquePath, false);
|
||||||
}
|
}
|
||||||
// selectedCells = [currentCell];
|
// selectedCells = [currentCell];
|
||||||
|
|||||||
Reference in New Issue
Block a user