feat: fix parsing

This commit is contained in:
2026-01-18 10:33:09 +01:00
parent 6bad5fbaf9
commit ee1db93298
4 changed files with 210 additions and 40 deletions

View File

@@ -128,9 +128,10 @@
>
<div class="space-y-2">
<OperationCard
v-for="(cat, idx) in data.data?.recapitulatif_operations"
v-for="(group, idx) in operationsGroupedByCategory"
:key="idx"
:category="cat"
:categorie="group.categorie"
:operations="group.operations"
/>
</div>
</DataSection>
@@ -140,7 +141,7 @@
</template>
<script setup>
import { ref, reactive } from 'vue'
import { ref, reactive, computed } from 'vue'
import DataSection from './DataSection.vue'
import DataCard from './DataCard.vue'
import DataRow from './DataRow.vue'
@@ -158,6 +159,27 @@ const props = defineProps({
}
})
// Grouper les operations par categorie pour l'affichage
const operationsGroupedByCategory = computed(() => {
const operations = props.data?.data?.recapitulatif_operations
if (!operations || !Array.isArray(operations)) return []
// Grouper par categorie en preservant l'ordre d'apparition
const groups = []
const categoryIndex = {}
for (const op of operations) {
const cat = op.categorie || 'AUTRES'
if (!(cat in categoryIndex)) {
categoryIndex[cat] = groups.length
groups.push({ categorie: cat, operations: [] })
}
groups[categoryIndex[cat]].operations.push(op)
}
return groups
})
const copyLabel = ref('Copier')
const expandedSections = reactive({
metadata: true,