Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 8862-testIsolationFalse
gitea/salix-front/pipeline/pr-dev This commit is unstable
Details
gitea/salix-front/pipeline/pr-dev This commit is unstable
Details
This commit is contained in:
commit
f3f1ec8039
|
@ -18,6 +18,7 @@ $positive: #c8e484;
|
|||
$negative: #fb5252;
|
||||
$info: #84d0e2;
|
||||
$warning: #f4b974;
|
||||
$neutral: #b0b0b0;
|
||||
// Pendiente de cuadrar con la base de datos
|
||||
$success: $positive;
|
||||
$alert: $negative;
|
||||
|
@ -51,3 +52,6 @@ $width-xl: 1600px;
|
|||
.bg-alert {
|
||||
background-color: $negative;
|
||||
}
|
||||
.bg-neutral {
|
||||
background-color: $neutral;
|
||||
}
|
||||
|
|
|
@ -28,14 +28,8 @@ const entityId = computed(() => {
|
|||
return $props.id || route.params.id;
|
||||
});
|
||||
|
||||
const STATE_COLOR = {
|
||||
pending: 'warning',
|
||||
incomplete: 'info',
|
||||
resolved: 'positive',
|
||||
canceled: 'negative',
|
||||
};
|
||||
function stateColor(code) {
|
||||
return STATE_COLOR[code];
|
||||
function stateColor(entity) {
|
||||
return entity?.claimState?.classColor;
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
|
@ -57,9 +51,8 @@ onMounted(async () => {
|
|||
<VnLv v-if="entity.claimState" :label="t('claim.state')">
|
||||
<template #value>
|
||||
<QBadge
|
||||
:color="stateColor(entity.claimState.code)"
|
||||
text-color="black"
|
||||
dense
|
||||
:color="stateColor(entity)"
|
||||
style="color: var(--vn-black-text-color)"
|
||||
>
|
||||
{{ entity.claimState.description }}
|
||||
</QBadge>
|
||||
|
|
|
@ -108,15 +108,9 @@ const markerLabels = [
|
|||
{ value: 5, label: t('claim.person') },
|
||||
];
|
||||
|
||||
const STATE_COLOR = {
|
||||
pending: 'warning',
|
||||
incomplete: 'info',
|
||||
resolved: 'positive',
|
||||
canceled: 'negative',
|
||||
};
|
||||
|
||||
function stateColor(code) {
|
||||
return STATE_COLOR[code];
|
||||
const claimState = claimStates.value.find((state) => state.code === code);
|
||||
return claimState?.classColor;
|
||||
}
|
||||
|
||||
const developmentColumns = ref([
|
||||
|
@ -188,7 +182,7 @@ function claimUrl(section) {
|
|||
<template>
|
||||
<FetchData
|
||||
url="ClaimStates"
|
||||
:filter="{ fields: ['id', 'description'] }"
|
||||
:filter="{ fields: ['id', 'description', 'code', 'classColor'] }"
|
||||
@on-fetch="(data) => (claimStates = data)"
|
||||
auto-load
|
||||
/>
|
||||
|
|
|
@ -101,7 +101,10 @@ const columns = computed(() => [
|
|||
name: 'stateCode',
|
||||
chip: {
|
||||
condition: () => true,
|
||||
color: ({ stateCode }) => STATE_COLOR[stateCode] ?? 'bg-grey',
|
||||
color: ({ stateCode }) => {
|
||||
const state = states.value?.find(({ code }) => code === stateCode);
|
||||
return `bg-${state.classColor}`;
|
||||
},
|
||||
},
|
||||
columnFilter: {
|
||||
name: 'claimStateFk',
|
||||
|
@ -131,12 +134,6 @@ const columns = computed(() => [
|
|||
],
|
||||
},
|
||||
]);
|
||||
|
||||
const STATE_COLOR = {
|
||||
pending: 'bg-warning',
|
||||
loses: 'bg-negative',
|
||||
resolved: 'bg-positive',
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
Loading…
Reference in New Issue