-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rota de busca horario do cliente agendado (#4)
Co-authored-by: brunohendias <brunodiashen@gmail.com>
- Loading branch information
1 parent
151d00e
commit ccf406f
Showing
13 changed files
with
183 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<template> | ||
<ul class="list-group"> | ||
<spinner v-if="loading" /> | ||
<div v-else class="text-center"> | ||
<span class="text-success">Agendado</span> | ||
<li v-for="(dado, i) in dados" :key="i"> | ||
<p> | ||
{{ dado.nome }} | ||
{{ formaters.data(dado.data) }} | ||
</p> | ||
</li> | ||
</div> | ||
</ul> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { busca } from '@/core/functions' | ||
import { formaters } from '@/core/helpers' | ||
import spinner from '../spinner.vue' | ||
import { ref, computed, onMounted } from 'vue' | ||
import { useStore } from 'vuex' | ||
import { Agendado, State } from '@/core/interfaces' | ||
import { Actions } from '@/core/enums' | ||
const store = useStore() | ||
const state: State = store.state | ||
const loading = ref<boolean>(false) | ||
const action: string = Actions.alteraHorariosAgendados | ||
const path: string = 'agendamento/cliente' | ||
const dados = computed(() | ||
: Agendado[] => | ||
state.horarios.agendados | ||
) | ||
onMounted(() | ||
: void => { | ||
loading.value = true | ||
busca(path, action, store) | ||
.finally(() => loading.value = false) | ||
}) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<template> | ||
<ul class="list-group"> | ||
<spinner v-if="loading" /> | ||
<div v-else class="text-center"> | ||
<span class="text-primary">Solicitado</span> | ||
<li v-for="(dado, i) in dados" :key="i"> | ||
<p> | ||
{{ dado.nome }} | ||
{{ formaters.data(dado.data) }} | ||
</p> | ||
</li> | ||
</div> | ||
</ul> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { busca } from '@/core/functions' | ||
import { formaters } from '@/core/helpers' | ||
import spinner from '../spinner.vue' | ||
import { bus, Events } from '@/core/bus' | ||
import { ref, computed, onMounted, watch } from 'vue' | ||
import { useStore } from 'vuex' | ||
import { Pendente, State } from '@/core/interfaces' | ||
import { Actions } from '@/core/enums' | ||
const store = useStore() | ||
const state: State = store.state | ||
const loading = ref<boolean>(false) | ||
const action: string = Actions.alteraHorariosPendentes | ||
const path: string = 'pendente/me' | ||
const dados = computed(() | ||
: Pendente[] => | ||
state.horarios.pendentes | ||
) | ||
onMounted(() | ||
: void => { | ||
loading.value = true | ||
busca(path, action, store) | ||
.finally(() => loading.value = false) | ||
}) | ||
watch(() => bus.on(Events.recarrega_horarios_pendente), | ||
() => busca(path, action, store)) | ||
</script> | ||
|
||
<style> | ||
.horario-pendente { | ||
width: 20px; | ||
height: 20px; | ||
background-color: orange; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<template> | ||
<div class="dropdown"> | ||
<button class="btn dropdown-toggle" type="button" id="meus-horarios" data-bs-toggle="dropdown" | ||
aria-expanded="false"> | ||
Meus horarios | ||
</button> | ||
<ul class="dropdown-menu" aria-labelledby="meus-horarios"> | ||
<horariosAgendado /> | ||
<hr> | ||
<horariosPendente /> | ||
</ul> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import horariosAgendado from './listas/horariosAgendado.vue'; | ||
import horariosPendente from './listas/horariosPendente.vue'; | ||
</script> |
Oops, something went wrong.