0
0
Fork 0

refs #5986 fix state color

This commit is contained in:
Jorge Penadés 2023-08-08 11:35:35 +02:00
parent f94f87590a
commit 8ba7615aee
3 changed files with 11 additions and 8 deletions

View File

@ -67,7 +67,12 @@ const filter = {
}, },
], ],
}; };
function stateColor(state) {
if (state.code === 'OK') return 'text-green';
if (state.code === 'FREE') return 'text-blue-3';
if (state.alertLevel === 1) return 'text-primary';
if (state.alertLevel === 0) return 'text-red';
}
const data = ref(useCardDescription()); const data = ref(useCardDescription());
const setData = (entity) => const setData = (entity) =>
(data.value = useCardDescription(entity.client.name, entity.id)); (data.value = useCardDescription(entity.client.name, entity.id));
@ -88,9 +93,9 @@ const setData = (entity) =>
<template #body="{ entity }"> <template #body="{ entity }">
<VnLv v-if="entity.ticketState" :label="t('ticket.card.state')"> <VnLv v-if="entity.ticketState" :label="t('ticket.card.state')">
<template #value> <template #value>
<QChip square size="sm" :color="entity.ticketState.state.classColor"> <span :class="stateColor(entity.ticketState.state)">
{{ entity.ticketState.state.name }} {{ entity.ticketState.state.name }}
</QChip> </span>
</template> </template>
</VnLv> </VnLv>
<VnLv :label="t('ticket.card.shipped')" :value="toDate(entity.shipped)" /> <VnLv :label="t('ticket.card.shipped')" :value="toDate(entity.shipped)" />

View File

@ -136,7 +136,7 @@ async function changeState(value) {
{{ t('ticket.summary.state') }} {{ t('ticket.summary.state') }}
</QItemLabel> </QItemLabel>
<QItemLabel <QItemLabel
:class="`text-${ticket.ticketState.state.classColor}`" :class="stateColor(ticket.ticketState.state)"
> >
{{ ticket.ticketState.state.name }} {{ ticket.ticketState.state.name }}
</QItemLabel> </QItemLabel>

View File

@ -142,15 +142,13 @@ function viewSummary(id) {
{{ t('ticket.list.state') }} {{ t('ticket.list.state') }}
</QItemLabel> </QItemLabel>
<QItemLabel> <QItemLabel>
<QChip <QBadge
square
size="sm"
:color="stateColor(row)" :color="stateColor(row)"
class="q-ma-none" class="q-ma-none"
dense dense
> >
{{ row.state }} {{ row.state }}
</QChip> </QBadge>
</QItemLabel> </QItemLabel>
</QItemSection> </QItemSection>
</QItem> </QItem>