feat(fer-19) : affichage etat pont-bascule et desactivation du bouton peser
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2,7 +2,15 @@
|
|||||||
<div class="flex justify-center">
|
<div class="flex justify-center">
|
||||||
<div class="flex flex-col items-center w-[660px]">
|
<div class="flex flex-col items-center w-[660px]">
|
||||||
<h1 class="font-bold text-5xl uppercase text-primary-500">{{ title }}</h1>
|
<h1 class="font-bold text-5xl uppercase text-primary-500">{{ title }}</h1>
|
||||||
<p class="text-primary-500 uppercase text-2xl mt-2">Pont-bascule connecté</p>
|
<p
|
||||||
|
v-if="pontBasculeStatus === 'checking'"
|
||||||
|
class="uppercase text-2xl mt-2 text-primary-500">Vérification du pont-bascule…</p>
|
||||||
|
<p
|
||||||
|
v-else-if="pontBasculeStatus === 'connected'"
|
||||||
|
class="uppercase text-2xl mt-2 text-green-600">Pont-bascule connecté</p>
|
||||||
|
<p
|
||||||
|
v-else
|
||||||
|
class="uppercase text-2xl mt-2 text-red-600">Pont-bascule non connecté</p>
|
||||||
<div
|
<div
|
||||||
v-if="!displayWeight"
|
v-if="!displayWeight"
|
||||||
class="w-full flex flex-col items-center justify-center border border-black h-[90px] mt-12 mb-[86px]">
|
class="w-full flex flex-col items-center justify-center border border-black h-[90px] mt-12 mb-[86px]">
|
||||||
@@ -19,6 +27,7 @@
|
|||||||
<div class="flex justify-center mt-[54px]">
|
<div class="flex justify-center mt-[54px]">
|
||||||
<UiButton
|
<UiButton
|
||||||
class="text-xl uppercase bg-primary-500 text-white h-[50px] w-[272px]"
|
class="text-xl uppercase bg-primary-500 text-white h-[50px] w-[272px]"
|
||||||
|
:disabled="pontBasculeStatus !== 'connected'"
|
||||||
@click="fetchWeight"
|
@click="fetchWeight"
|
||||||
>{{ displayWeight !== null ? 'refaire une pesée' : 'peser' }}</UiButton>
|
>{{ displayWeight !== null ? 'refaire une pesée' : 'peser' }}</UiButton>
|
||||||
<UiButton
|
<UiButton
|
||||||
@@ -35,7 +44,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { toRef } from 'vue'
|
import { onMounted, toRef } from 'vue'
|
||||||
|
import { usePontBascule } from '~/composables/usePontBascule'
|
||||||
import { useWeighingStep } from '~/composables/steps/useWeighingStep'
|
import { useWeighingStep } from '~/composables/steps/useWeighingStep'
|
||||||
import type { WeightData } from '~/services/dto/weight-data'
|
import type { WeightData } from '~/services/dto/weight-data'
|
||||||
|
|
||||||
@@ -55,6 +65,9 @@ const props = defineProps<{
|
|||||||
|
|
||||||
const entityRef = toRef(props, 'entity')
|
const entityRef = toRef(props, 'entity')
|
||||||
|
|
||||||
|
const { status: pontBasculeStatus, checkHealth } = usePontBascule()
|
||||||
|
onMounted(checkHealth)
|
||||||
|
|
||||||
const {
|
const {
|
||||||
displayWeight,
|
displayWeight,
|
||||||
title,
|
title,
|
||||||
|
|||||||
Reference in New Issue
Block a user