mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-22 19:16:01 +00:00
view data improvements
This commit is contained in:
@@ -52,7 +52,7 @@ export default class ChangeSetGrider extends Grider {
|
||||
) {
|
||||
super();
|
||||
this.changeSet = changeSetState && changeSetState.value;
|
||||
this.insertedRows = getChangeSetInsertedRows(this.changeSet, display?.baseTableOrCollection);
|
||||
this.insertedRows = getChangeSetInsertedRows(this.changeSet, display?.baseTableOrSimilar);
|
||||
this.setChangeSet = value => dispatchChangeSet({ type: 'set', value });
|
||||
this.rowCacheIndexes = new Set();
|
||||
this.rowDataCache = {};
|
||||
@@ -169,7 +169,7 @@ export default class ChangeSetGrider extends Grider {
|
||||
|
||||
get rowCountInUpdate() {
|
||||
if (this.batchChangeSet) {
|
||||
const newRows = getChangeSetInsertedRows(this.batchChangeSet, this.display.baseTable);
|
||||
const newRows = getChangeSetInsertedRows(this.batchChangeSet, this.display.baseTableOrSimilar);
|
||||
return this.sourceRows.length + newRows.length;
|
||||
} else {
|
||||
return this.rowCount;
|
||||
@@ -178,13 +178,13 @@ export default class ChangeSetGrider extends Grider {
|
||||
|
||||
insertRow(): number {
|
||||
const res = this.rowCountInUpdate;
|
||||
this.applyModification(chs => changeSetInsertNewRow(chs, this.display.baseTableOrCollection));
|
||||
this.applyModification(chs => changeSetInsertNewRow(chs, this.display.baseTableOrSimilar));
|
||||
return res;
|
||||
}
|
||||
|
||||
insertDocuments(documents: any[]): number {
|
||||
const res = this.rowCountInUpdate;
|
||||
this.applyModification(chs => changeSetInsertDocuments(chs, documents, this.display.baseTableOrCollection));
|
||||
this.applyModification(chs => changeSetInsertDocuments(chs, documents, this.display.baseTableOrSimilar));
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -758,15 +758,18 @@
|
||||
|
||||
// $: console.log('DISPLAY.config', display.config);
|
||||
$: {
|
||||
if (display?.groupColumns && display?.baseTable) {
|
||||
if (display?.groupColumns && display?.baseTableOrSimilar && onReferenceClick) {
|
||||
onReferenceClick({
|
||||
referenceId: stableStringify(display && display.groupColumns),
|
||||
schemaName: display.baseTable.schemaName,
|
||||
pureName: display.baseTable.pureName,
|
||||
schemaName: display.baseTableOrSimilar?.schemaName,
|
||||
pureName: display.baseTableOrSimilar?.pureName,
|
||||
columns: display.groupColumns.map(col => ({
|
||||
baseName: col,
|
||||
refName: col,
|
||||
dataType: _.get(display.baseTable && display.baseTable.columns.find(x => x.columnName == col), 'dataType'),
|
||||
dataType: _.get(
|
||||
display.baseTableOrView?.columns?.find(x => x.columnName == col),
|
||||
'dataType'
|
||||
),
|
||||
})),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -68,7 +68,6 @@
|
||||
|
||||
return parseInt(response.data.rows[0].count);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
@@ -128,7 +127,7 @@
|
||||
initialValues.sourceConnectionId = conid;
|
||||
initialValues.sourceDatabaseName = database;
|
||||
initialValues.sourceSql = display.getExportQuery();
|
||||
initialValues.sourceList = display.baseTable ? [display.baseTable.pureName] : [];
|
||||
initialValues.sourceList = display.baseTableOrSimilar ? [display.baseTableOrSimilar.pureName] : [];
|
||||
showModal(ImportExportModal, { initialValues });
|
||||
}
|
||||
|
||||
@@ -139,8 +138,8 @@
|
||||
icon: 'img sql-file',
|
||||
tabComponent: 'QueryTab',
|
||||
props: {
|
||||
schemaName: display.baseTable.schemaName,
|
||||
pureName: display.baseTable.pureName,
|
||||
schemaName: display.baseTableOrSimilar?.schemaName,
|
||||
pureName: display.baseTableOrSimilar?.pureName,
|
||||
conid,
|
||||
database,
|
||||
},
|
||||
@@ -198,7 +197,6 @@
|
||||
},
|
||||
{ command: 'sqlDataGrid.export', tag: 'export' }
|
||||
);
|
||||
|
||||
</script>
|
||||
|
||||
<LoadingDataGridCore
|
||||
|
||||
Reference in New Issue
Block a user