forked from verdnatura/salix-front
refs #5986 refactored ticket stateColor
This commit is contained in:
parent
8ba7615aee
commit
eb95ff18ec
|
@ -67,12 +67,7 @@ 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));
|
||||
|
@ -93,9 +88,15 @@ const setData = (entity) =>
|
|||
<template #body="{ entity }">
|
||||
<VnLv v-if="entity.ticketState" :label="t('ticket.card.state')">
|
||||
<template #value>
|
||||
<span :class="stateColor(entity.ticketState.state)">
|
||||
<QBadge
|
||||
:color="
|
||||
entity.ticketState.state.classColor
|
||||
? entity.ticketState.state.classColor
|
||||
: 'dark'
|
||||
"
|
||||
>
|
||||
{{ entity.ticketState.state.name }}
|
||||
</span>
|
||||
</QBadge>
|
||||
</template>
|
||||
</VnLv>
|
||||
<VnLv :label="t('ticket.card.shipped')" :value="toDate(entity.shipped)" />
|
||||
|
|
|
@ -135,10 +135,16 @@ async function changeState(value) {
|
|||
<QItemLabel caption>
|
||||
{{ t('ticket.summary.state') }}
|
||||
</QItemLabel>
|
||||
<QItemLabel
|
||||
:class="stateColor(ticket.ticketState.state)"
|
||||
>
|
||||
{{ ticket.ticketState.state.name }}
|
||||
<QItemLabel>
|
||||
<QBadge
|
||||
:color="
|
||||
ticket.ticketState.state.classColor
|
||||
? ticket.ticketState.state.classColor
|
||||
: 'dark'
|
||||
"
|
||||
>
|
||||
{{ ticket.ticketState.state.name }}
|
||||
</QBadge>
|
||||
</QItemLabel>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
|
|
Loading…
Reference in New Issue