mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 07:16:01 +00:00
mong support WIP
This commit is contained in:
46
packages/datalib/src/CollectionGridDisplay.ts
Normal file
46
packages/datalib/src/CollectionGridDisplay.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
import _ from 'lodash';
|
||||
import { GridDisplay, ChangeCacheFunc, ChangeConfigFunc } from './GridDisplay';
|
||||
import { EngineDriver, ViewInfo, ColumnInfo, CollectionInfo } from 'dbgate-types';
|
||||
import { GridConfig, GridCache } from './GridConfig';
|
||||
|
||||
export class CollectionGridDisplay extends GridDisplay {
|
||||
constructor(
|
||||
public collection: CollectionInfo,
|
||||
driver: EngineDriver,
|
||||
config: GridConfig,
|
||||
setConfig: ChangeConfigFunc,
|
||||
cache: GridCache,
|
||||
setCache: ChangeCacheFunc
|
||||
) {
|
||||
super(config, setConfig, cache, setCache, driver);
|
||||
this.columns = [];
|
||||
this.filterable = true;
|
||||
this.sortable = true;
|
||||
this.editable = false;
|
||||
this.supportsReload = true;
|
||||
}
|
||||
|
||||
// getDisplayColumns(view: ViewInfo) {
|
||||
// return (
|
||||
// view?.columns
|
||||
// ?.map(col => this.getDisplayColumn(view, col))
|
||||
// ?.map(col => ({
|
||||
// ...col,
|
||||
// isChecked: this.isColumnChecked(col),
|
||||
// })) || []
|
||||
// );
|
||||
// }
|
||||
|
||||
// getDisplayColumn(view: ViewInfo, col: ColumnInfo) {
|
||||
// const uniquePath = [col.columnName];
|
||||
// const uniqueName = uniquePath.join('.');
|
||||
// return {
|
||||
// ...col,
|
||||
// pureName: view.pureName,
|
||||
// schemaName: view.schemaName,
|
||||
// headerText: col.columnName,
|
||||
// uniqueName,
|
||||
// uniquePath,
|
||||
// };
|
||||
// }
|
||||
}
|
||||
Reference in New Issue
Block a user