mirror of https://github.com/Fabio286/antares.git
fix: mismatch between table field columns and results with duplicate fields, fixes #848
This commit is contained in:
parent
37d44c95ee
commit
da8cc39157
|
@ -38,7 +38,7 @@
|
|||
<div class="thead">
|
||||
<div class="tr">
|
||||
<div
|
||||
v-for="(field, index) in fields"
|
||||
v-for="(field, index) in filteredFields"
|
||||
:key="index"
|
||||
class="th c-hand"
|
||||
:title="`${field.type} ${fieldLength(field) ? `(${fieldLength(field)})` : ''}`"
|
||||
|
@ -383,6 +383,11 @@ const sortedResults = computed(() => {
|
|||
|
||||
const resultsWithRows = computed(() => props.results.filter(result => result.rows.length));
|
||||
const fields = computed(() => resultsWithRows.value.length ? resultsWithRows.value[resultsetIndex.value].fields : []);
|
||||
const filteredFields = computed(() => fields.value.reduce((acc, cur) => {
|
||||
if (acc.findIndex(f => JSON.stringify(f) === JSON.stringify(cur)))
|
||||
acc.push(cur);
|
||||
return acc;
|
||||
}, [] as TableField[]));
|
||||
const keyUsage = computed(() => resultsWithRows.value.length ? resultsWithRows.value[resultsetIndex.value].keys : []);
|
||||
|
||||
const fieldsObj = computed(() => {
|
||||
|
|
Loading…
Reference in New Issue