mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 10:16:00 +00:00
33 lines
896 B
TypeScript
33 lines
896 B
TypeScript
import { GridDisplay, ChangeCacheFunc } from './GridDisplay';
|
|
import { QueryResultColumn } from '@dbgate/types';
|
|
import { GridConfig, GridCache } from './GridConfig';
|
|
|
|
export class JslGridDisplay extends GridDisplay {
|
|
constructor(
|
|
jslid,
|
|
columns: QueryResultColumn[],
|
|
config: GridConfig,
|
|
setConfig: (config: GridConfig) => void,
|
|
cache: GridCache,
|
|
setCache: ChangeCacheFunc
|
|
) {
|
|
super(config, setConfig, cache, setCache, null, null);
|
|
|
|
this.columns = columns
|
|
.map((col) => ({
|
|
columnName: col.columnName,
|
|
headerText: col.columnName,
|
|
uniqueName: col.columnName,
|
|
uniquePath: [col.columnName],
|
|
notNull: col.notNull,
|
|
autoIncrement: col.autoIncrement,
|
|
pureName: null,
|
|
schemaName: null,
|
|
}))
|
|
?.map((col) => ({
|
|
...col,
|
|
isChecked: this.isColumnChecked(col),
|
|
}));
|
|
}
|
|
}
|