forked from verdnatura/salix-front
Implement WorkerDateLabel
This commit is contained in:
parent
71a4a20f20
commit
5964189a83
|
@ -0,0 +1,40 @@
|
||||||
|
<script setup>
|
||||||
|
defineProps({
|
||||||
|
color: {
|
||||||
|
type: String,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
avatarClass: {
|
||||||
|
type: String,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
selected: {
|
||||||
|
type: Boolean,
|
||||||
|
default: undefined,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
defineEmits(['update:selected']);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<QChip
|
||||||
|
class="chip"
|
||||||
|
:selected="selected"
|
||||||
|
:style="selected ? { backgroundColor: color } : null"
|
||||||
|
:text-color="selected ? 'white' : null"
|
||||||
|
@update:selected="$emit('update:selected', $event)"
|
||||||
|
>
|
||||||
|
<QAvatar
|
||||||
|
:color="color"
|
||||||
|
:class="avatarClass"
|
||||||
|
:style="{ backgroundColor: color }"
|
||||||
|
/>
|
||||||
|
<slot />
|
||||||
|
</QChip>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.chip {
|
||||||
|
background-color: var(--vn-light-gray);
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -7,6 +7,7 @@ import FetchData from 'components/FetchData.vue';
|
||||||
import WorkerTimeHourChip from 'components/WorkerTimeHourChip.vue';
|
import WorkerTimeHourChip from 'components/WorkerTimeHourChip.vue';
|
||||||
import WorkerTimeForm from 'components/WorkerTimeForm.vue';
|
import WorkerTimeForm from 'components/WorkerTimeForm.vue';
|
||||||
import WorkerTimeReasonForm from 'components/WorkerTimeReasonForm.vue';
|
import WorkerTimeReasonForm from 'components/WorkerTimeReasonForm.vue';
|
||||||
|
import WorkerDateLabel from './WorkerDateLabel.vue';
|
||||||
|
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
@ -552,12 +553,15 @@ onMounted(async () => {
|
||||||
<div class="column-title-container">
|
<div class="column-title-container">
|
||||||
<span class="text-primary">{{ t(col.label) }}</span>
|
<span class="text-primary">{{ t(col.label) }}</span>
|
||||||
<span>{{ col.formattedDate }}</span>
|
<span>{{ col.formattedDate }}</span>
|
||||||
<QBadge
|
<WorkerDateLabel
|
||||||
v-if="col.dayData?.event"
|
v-if="col.dayData?.event"
|
||||||
:style="`background-color: ${col.dayData.event.color}`"
|
:color="col.dayData.event.color"
|
||||||
|
selected
|
||||||
>
|
>
|
||||||
{{ col.dayData.event.name }}
|
<span>
|
||||||
</QBadge>
|
{{ col.dayData.event.name }}
|
||||||
|
</span>
|
||||||
|
</WorkerDateLabel>
|
||||||
</div>
|
</div>
|
||||||
</QTh>
|
</QTh>
|
||||||
</QTr>
|
</QTr>
|
||||||
|
|
Loading…
Reference in New Issue