Logica de infoTags movida a modulo ui

This commit is contained in:
Alejandro Tasistro 2025-06-16 17:05:18 -03:00
parent d9747c9280
commit a16487cc3f
2 changed files with 10 additions and 6 deletions

View file

@ -1,13 +1,14 @@
<script>
import { mapActions, mapState } from "vuex";
import { mapActions, mapMutations, mapState } from "vuex";
export default {
name: "InfoTags",
computed: {
...mapState("ui", ["canasta_actual"])
...mapState("ui", ["canasta_actual", "show_tags"])
},
methods: {
...mapActions("ui", ["getCanastaActual"]),
...mapMutations("ui", ["toggleTags"])
},
async mounted() {
await this.getCanastaActual();
@ -19,7 +20,6 @@ export default {
return {
nombreCanasta: "",
fechaCanasta: "",
visible: true,
}
},
}
@ -27,14 +27,14 @@ export default {
<template>
<div>
<div v-if="!visible" class="info-tab" @click="visible = true">
<div v-if="!show_tags" class="info-tab" @click="toggleTags">
<button class="button is-borderless" type="button">
<span class="icon">
<i class="fas fa-info-circle"></i>
</span>
</button>
</div>
<div v-if="visible" class="box sticky-tags">
<div v-if="show_tags" class="box sticky-tags">
<div class="field is-grouped is-grouped-multiline">
<div class="control">
<div class="tags has-addons">
@ -48,7 +48,7 @@ export default {
<span class="tag is-danger">{{ fechaCanasta }}</span>
</div>
</div>
<button class="delete" type="button" @click="visible = false"></button>
<button class="delete" type="button" @click="toggleTags"></button>
</div>
</div>
</div>

View file

@ -1,6 +1,7 @@
const state = {
show_chismosa: false,
show_devoluciones: false,
show_tags: true,
migas: [{ nombre: 'Pedidos', action: 'pedido/resetear' }],
canasta_actual: null,
};
@ -15,6 +16,9 @@ const mutations = {
toggleDevoluciones(state) {
state.show_devoluciones = !state.show_devoluciones;
},
toggleTags(state) {
state.show_tags = !state.show_tags;
},
addMiga(state, miga) {
state.migas.push(miga);
},