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 setData = (entity) =>
(data.value = useCardDescription(entity.client.name, entity.id));
@ -88,9 +93,9 @@ const setData = (entity) =>
<template #body="{ entity }">
<VnLv v-if="entity.ticketState" :label="t('ticket.card.state')">
<template #value>
<QChip square size="sm" :color="entity.ticketState.state.classColor">
<span :class="stateColor(entity.ticketState.state)">
{{ entity.ticketState.state.name }}
</QChip>
</span>
</template>
</VnLv>
<VnLv :label="t('ticket.card.shipped')" :value="toDate(entity.shipped)" />

View File

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

View File

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