feat(frontend): vues MVP — dashboard, jardins, grille, variétés, tâches, plantations
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,35 @@
|
||||
<template>
|
||||
<div class="p-4">
|
||||
<h1 class="text-2xl font-bold text-green">Plantations</h1>
|
||||
<div class="p-4 max-w-2xl mx-auto">
|
||||
<h1 class="text-2xl font-bold text-green mb-6">Plantations</h1>
|
||||
<div v-if="store.loading" class="text-text-muted text-sm">Chargement...</div>
|
||||
<div v-for="p in store.plantings" :key="p.id"
|
||||
class="bg-bg-soft rounded-lg p-4 mb-3 border border-bg-hard">
|
||||
<div class="flex items-start gap-3">
|
||||
<div class="flex-1">
|
||||
<div class="text-text font-medium">Plantation #{{ p.id }}</div>
|
||||
<div class="text-text-muted text-xs mt-1">
|
||||
Jardin {{ p.garden_id }} · Variété {{ p.variety_id }} · {{ p.quantite }} plant(s)
|
||||
</div>
|
||||
<span class="inline-block mt-2 text-xs px-2 py-0.5 rounded" :class="{
|
||||
'bg-blue/20 text-blue': p.statut === 'prevu',
|
||||
'bg-green/20 text-green': p.statut === 'en_cours',
|
||||
'bg-text-muted/20 text-text-muted': p.statut === 'termine',
|
||||
'bg-red/20 text-red': p.statut === 'echoue',
|
||||
}">{{ p.statut }}</span>
|
||||
</div>
|
||||
<button class="text-text-muted hover:text-red text-sm" @click="store.remove(p.id!)">✕</button>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="!store.loading && !store.plantings.length" class="text-text-muted text-sm text-center py-8">
|
||||
Aucune plantation enregistrée.
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted } from 'vue'
|
||||
import { usePlantingsStore } from '@/stores/plantings'
|
||||
|
||||
const store = usePlantingsStore()
|
||||
onMounted(() => store.fetchAll())
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user