Merge pull request #21 from josedario87/feature/form-background-color

Feature/form background color
This commit is contained in:
josedario87
2025-05-31 02:36:14 -06:00
committed by GitHub
4 changed files with 16 additions and 7 deletions

View File

@@ -1,5 +1,5 @@
<template> <template>
<div class="asistencia-form-container"> <div class="asistencia-form-container" :style="{ backgroundColor: uiStore.tableBgColorAsistencias }">
<h2>{{ formTitle }}</h2> <h2>{{ formTitle }}</h2>
<form @submit.prevent="handleSubmit"> <form @submit.prevent="handleSubmit">
<div class="form-group"> <div class="form-group">
@@ -48,6 +48,7 @@
<script setup> <script setup>
import { ref, reactive, onMounted, onUnmounted, computed, watch } from 'vue'; import { ref, reactive, onMounted, onUnmounted, computed, watch } from 'vue';
import { useAsistenciasStore } from '../../stores/useAsistencias'; import { useAsistenciasStore } from '../../stores/useAsistencias';
import { useUi } from '@/stores/useUi'; // Corrected UI store import
import { useRouter, useRoute } from 'vue-router'; import { useRouter, useRoute } from 'vue-router';
const props = defineProps({ const props = defineProps({
@@ -57,6 +58,7 @@ const props = defineProps({
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
const asistenciasStore = useAsistenciasStore(); const asistenciasStore = useAsistenciasStore();
const uiStore = useUi(); // Corrected UI store instantiation
const formatDateTimeForInput = (dateString) => { const formatDateTimeForInput = (dateString) => {
const date = dateString ? new Date(dateString) : new Date(); const date = dateString ? new Date(dateString) : new Date();
@@ -207,7 +209,7 @@ const handleCancel = () => {
max-width: 600px; max-width: 600px;
margin: 20px auto; margin: 20px auto;
padding: 25px; padding: 25px;
background-color: #f9f9f9; /* background-color: #f9f9f9; */ /* Removed to use dynamic background */
border-radius: 8px; border-radius: 8px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1); box-shadow: 0 2px 10px rgba(0,0,0,0.1);
} }

View File

@@ -6,7 +6,8 @@
<form <form
@submit.prevent="handleSubmit" @submit.prevent="handleSubmit"
class="max-w-lg mx-auto bg-white p-8 rounded-lg shadow-lg" class="max-w-lg mx-auto p-8 rounded-lg shadow-lg"
:style="{ backgroundColor: uiStore.tableBgColorEmpleados }"
> >
<!-- Nombre --> <!-- Nombre -->
<div class="mb-6"> <div class="mb-6">
@@ -149,6 +150,7 @@ import { ref, onMounted, computed } from 'vue'
import { useRoute, useRouter } from 'vue-router' import { useRoute, useRouter } from 'vue-router'
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
import { useEmpleadosStore } from '@/stores/useEmpleados.js' import { useEmpleadosStore } from '@/stores/useEmpleados.js'
import { useUi } from '@/stores/useUi'; // Corrected UI store import
/* ───── Tipos ───── */ /* ───── Tipos ───── */
interface EmpleadoForm { interface EmpleadoForm {
@@ -179,6 +181,7 @@ const router = useRouter()
/* ───── Store ───── */ /* ───── Store ───── */
const empleadosStore = useEmpleadosStore() const empleadosStore = useEmpleadosStore()
const { currentEmpleado } = storeToRefs(empleadosStore) const { currentEmpleado } = storeToRefs(empleadosStore)
const uiStore = useUi(); // Corrected UI store instantiation
/* ───── State ───── */ /* ───── State ───── */
const form = ref<EmpleadoForm>(defaultForm()) const form = ref<EmpleadoForm>(defaultForm())

View File

@@ -1,5 +1,5 @@
<template> <template>
<div class="planilla-form-container"> <div class="planilla-form-container" :style="{ backgroundColor: uiStore.tableBgColorPlanillas }">
<h2>{{ formTitle }}</h2> <h2>{{ formTitle }}</h2>
<form @submit.prevent="handleSubmit"> <form @submit.prevent="handleSubmit">
<div class="form-group"> <div class="form-group">
@@ -53,6 +53,7 @@
<script setup> <script setup>
import { ref, reactive, onMounted, computed, watch } from 'vue'; import { ref, reactive, onMounted, computed, watch } from 'vue';
import { usePlanillasStore } from '../../stores/usePlanillas'; import { usePlanillasStore } from '../../stores/usePlanillas';
import { useUi } from '@/stores/useUi'; // Corrected UI store import
import { useRouter, useRoute } from 'vue-router'; import { useRouter, useRoute } from 'vue-router';
const props = defineProps({ const props = defineProps({
@@ -63,6 +64,7 @@ const router = useRouter();
const route = useRoute(); // Can also get id from route.params.id const route = useRoute(); // Can also get id from route.params.id
const planillasStore = usePlanillasStore(); const planillasStore = usePlanillasStore();
const uiStore = useUi(); // Corrected UI store instantiation
const formData = reactive({ const formData = reactive({
titulo: '', titulo: '',
@@ -215,7 +217,7 @@ const handleCancel = () => {
max-width: 600px; max-width: 600px;
margin: 20px auto; margin: 20px auto;
padding: 20px; padding: 20px;
background-color: #f9f9f9; /* background-color: #f9f9f9; */ /* Removed to use dynamic background */
border-radius: 8px; border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1); box-shadow: 0 2px 4px rgba(0,0,0,0.1);
} }

View File

@@ -1,5 +1,5 @@
<template> <template>
<div class="tarea-form-container"> <div class="tarea-form-container" :style="{ backgroundColor: uiStore.tableBgColorTareas }">
<h2>{{ formTitle }}</h2> <h2>{{ formTitle }}</h2>
<form @submit.prevent="handleSubmit"> <form @submit.prevent="handleSubmit">
<div class="form-group"> <div class="form-group">
@@ -65,6 +65,7 @@
<script setup> <script setup>
import { ref, reactive, onMounted, onUnmounted, computed, watch } from 'vue'; import { ref, reactive, onMounted, onUnmounted, computed, watch } from 'vue';
import { useTareasStore } from '../../stores/useTareas'; import { useTareasStore } from '../../stores/useTareas';
import { useUi } from '@/stores/useUi'; // Corrected UI store import
import { useRouter, useRoute } from 'vue-router'; import { useRouter, useRoute } from 'vue-router';
const props = defineProps({ const props = defineProps({
@@ -74,6 +75,7 @@ const props = defineProps({
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
const tareasStore = useTareasStore(); const tareasStore = useTareasStore();
const uiStore = useUi(); // Corrected UI store instantiation
const formatDateForInput = (dateString) => { const formatDateForInput = (dateString) => {
const date = dateString ? new Date(dateString) : new Date(); const date = dateString ? new Date(dateString) : new Date();
@@ -227,7 +229,7 @@ const handleCancel = () => {
max-width: 650px; max-width: 650px;
margin: 20px auto; margin: 20px auto;
padding: 25px; padding: 25px;
background-color: #f9f9f9; /* background-color: #f9f9f9; */ /* Removed to use dynamic background */
border-radius: 8px; border-radius: 8px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1); box-shadow: 0 2px 10px rgba(0,0,0,0.1);
} }