PageSourceSearch

https://quintanaroodigital.com.mx/assets/Aulas-BfU0U0tz.js

js quintanaroodigital.com.mx collected 2026-10-09 16:53:22 UTC 4,062 bytes, 1 lines download raw bytes

1import{u as v,as as L,j as e,G as h,at as E,au as k,av as w,ai as _,b8 as B,c5 as G,bm as $,bn as u,r as S,c as F,h as I,al as H,L as N,H as V}from"./index-jEWGNYZt.js";import{P as y}from"./Pagina-Ng8_R9OE.js";import{S as j}from"./SeccionPagina-ijkA_Q2s.js";import{d as M}from"./Edit-BL3SEc4U.js";import{u as U}from"./useFormOriginal-DGO610_F.js";import{c as W,e as Q,a as q,g as z}from"./Aulas-D28eEhrO.js";import{I as J}from"./InputSelect-DNicbFpL.js";import{I as b}from"./InputText-C-yUmRoG.js";import{I as T}from"./InputNumber-CPKp9E_u.js";import{g as K,O as X,a as Y}from"./cursoEscolar-QGWius9h.js";import"./useObjectState-D8wnkhyh.js";function Z({data:s,onClickEdit:A,onClickDelete:l,isLoading:c,isRefetching:D}){const{t}=v(),C=[{name:"nombre",label:"Aula",options:{filter:!0}},{name:"grupo",label:"Grupo",options:{filter:!0}},{name:"edaddesde",label:"Desde",options:{filter:!0}},{name:"edadhasta",label:"Hasta",options:{filter:!0}},{name:"cupo",label:"Aspirantes actuales",options:{filter:!1}},{name:"cupoOnline",label:"Cupo Online",options:{filter:!1}},{name:"",label:"Disponibles Online",options:{filter:!1,customBodyRender:function(x,n,m){let r=n.currentTableData[n.rowIndex].index,o=s[r];return o.cupoOnline-o.registrosOnline}}},{name:"cupoPresencial",label:"Cupo Presencial",options:{filter:!1}},{name:"",label:"Disponibles Presencial",options:{filter:!1,customBodyRender:function(x,n,m){let r=n.currentTableData[n.rowIndex].index,o=s[r];return o.cupoPresencial-o.registrosPresenciales}}},{name:"",label:"Acciones",options:{filter:!1,customBodyRender:function(x,n,m){let r=n.currentTableData[n.rowIndex].index,o=s[r];return e.jsxs(_,{direction:"row",spacing:3,mx:2,children:[e.jsx(M,{sx:{cursor:"pointer"},onClick:()=>A(o)}),e.jsx(B,{sx:{cursor:"pointer"},onClick:()=>l(o._id)})]})}}}],P={...L(t,c),customFooter:function(x,n,m,r,o){const f=s?s.reduce((d,p)=>d+p.cupoOnline,0):"",i=s?s.reduce((d,p)=>d+p.cupoPresencial,0):"",g=s?s.reduce((d,p)=>d+p.registrosOnline,0):"",a=s?s.reduce((d,p)=>d+p.registrosPresenciales,0):"";return e.jsx(G,{children:e.jsxs($,{children:[e.jsx(u,{}),e.jsx(u,{}),e.jsx(u,{children:"TOTAL"}),e.jsx(u,{children:f}),e.jsx(u,{children:i}),e.jsx(u,{children:s?f-g:""}),e.jsx(u,{children:s?i-a:""}),e.jsx(u,{})]})})}},O={...k()};return e.jsx(h,{xs:12,children:e.jsx(E,{title:e.jsx(w,{loading:c||D,title:"Aulas del curso"}),data:s,columns:C,options:P,components:O})})}const R={_id:null,nombre:"",grupo:"",edaddesde:"",edadhasta:"",cupo:0,cupoPresencial:0,cupoOnline:0};function de(){const[s,A]=S.useState(()=>K()),[l,c,D,t]=U(R),{data:C,isLoading:P,isRefetching:O,refetch:x}=F(["aulas",s],()=>z(s)),{mutate:n,isLoading:m}=I(a=>W({curso:s,...a}),{onSuccess:g}),{mutate:r,isLoading:o}=I(a=>Q(a._id,a),{onSuccess:g}),{mutate:f}=I(a=>q(a),{onSuccess:x});S.useEffect(()=>{c({cupo:parseInt(l.cupoPresencial??0)+parseInt(l.cupoOnline??0)})},[l.cupoPresencial,l.cupoOnline]);const i=!!l._id;function g(){x(),c(R)}return e.jsxs(y,{titulo:"Aulas",children:[e.jsx(j,{titulo:"Curso Escolar",children:e.jsx(J,{value:s,onChange:a=>A(a.target.value),disabled:i,children:X.map(a=>e.jsx(H,{value:a,children:Y(a)},a))})}),e.jsxs(j,{titulo:"Crear Aula",children:[e.jsx(b,{xs:12,md:4,...t("nombre","Nombre")}),e.jsx(b,{xs:12,md:4,...t("grupo","Grupo")}),e.jsx(h,{xs:12,md:4}),e.jsxs(j,{titulo:"Rango de edad",children:[e.jsx(b,{xs:12,md:4,...t("edaddesde","Desde")}),e.jsx(b,{xs:12,md:4,...t("edadhasta","Hasta")})]}),e.jsx(T,{xs:12,md:4,...t("cupoPresencial","Cupo Presencial")}),e.jsx(T,{xs:12,md:4,...t("cupoOnline","Cupo Online")}),e.jsx(T,{xs:12,md:4,...t("cupo","Aspirantes actuales"),onChange:()=>{},disabled:!0}),e.jsx(h,{xs:12,md:4,children:e.jsx(N,{fullWidth:!0,variant:"contained",loading:i?o:m,children:i?"Editar Aula":"Crear Aula",onClick:()=>i?r(l):n(l)})}),i&&e.jsx(h,{xs:12,md:4,children:e.jsx(V,{fullWidth:!0,variant:"contained",children:"Cancelar",onClick:()=>c(R)})})]}),e.jsx(j,{titulo:"Aulas del Curso",children:e.jsx(Z,{data:C,onClickEdit:a=>c(a),onClickDelete:a=>f(a),isLoading:P,isRefetching:O})})]})}export{de as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.