1
1
mirror of https://github.com/Fabio286/antares.git synced 2025-06-05 21:59:22 +02:00

fix: duplicate header fields on join result tables

This commit is contained in:
2020-10-21 14:58:22 +02:00
parent 1658432fd3
commit ea9b489f5f
4 changed files with 67 additions and 19 deletions

View File

@ -212,7 +212,7 @@ export default {
},
getTable (index) {
if (this.resultsWithRows[index] && this.resultsWithRows[index].fields && this.resultsWithRows[index].fields.length)
return this.resultsWithRows[index].fields[0].table;
return this.resultsWithRows[index].fields[0].orgTable;
return '';
},
getSchema (index) {
@ -221,11 +221,14 @@ export default {
return this.workspaceSchema;
},
getPrimaryValue (row) {
console.log(row);
const primaryFieldName = Object.keys(row).find(prop => [
this.primaryField.alias,
this.primaryField.name,
`${this.primaryField.table}.${this.primaryField.alias}`,
`${this.primaryField.table}.${this.primaryField.name}`
`${this.primaryField.table}.${this.primaryField.name}`,
`${this.primaryField.tableAlias}.${this.primaryField.alias}`,
`${this.primaryField.tableAlias}.${this.primaryField.name}`
].includes(prop));
return row[primaryFieldName];
},