window.componentes = window.componentes || {}; const BaseSysDataComponentList = { template: `

ph-duotone ph-list-bullets Components

mdi-format-text Name mdi-format-text Description Created At mdi-dots-vertical-circle-outline mdi-dots-vertical-circle-outline
{{btn.icon || 'mdi-pointer'}} {{btn.title||'Custom Action'}}
{{btn.icon || 'mdi-pointer'}} {{btn.title||'Custom Action'}}
Details Update Delete
Show {{n*30}} Of {{data?.total ?? 0}} Eliminar Registro Ingrese el codigo: {{pin}} Eliminar Cerrar
`, data() { return { data:[], brick:{"id":"base_sys_data_component_list","owner":null,"table":"sys_data_components","name":"Components","description":null,"method":"get","type":"all","fields":[{"name":"id","label":"Id","type":"text","hint":"This field show [Id]","active":false,"PK":true},{"name":"name","label":"Name","type":"text","hint":"This field show [Name]","active":true},{"name":"description","label":"Description","type":"text","hint":"This field show [Description]","active":true},{"name":"variables","label":"Variables","type":"text","hint":"This field show [Variables]","active":false},{"name":"props","label":"Props","type":"text","hint":"This field show [Props]","active":false},{"name":"template","label":"Template","type":"text","hint":"This field show [Template]","active":false},{"name":"method","label":"Method","type":"text","hint":"This field show [Method]","active":false},{"name":"created","label":"Created","type":"text","hint":"This field show [Created]","active":false},{"name":"mounted","label":"Mounted","type":"text","hint":"This field show [Mounted]","active":false},{"name":"watch","label":"Watch","type":"text","hint":"This field show [Watch]","active":false},{"name":"computed","label":"Computed","type":"text","hint":"This field show [Computed]","active":false},{"name":"created_at","label":"Created At","type":"date","hint":"This field show [Created At]","active":true}],"template":[],"custom_template":null,"custom_functions":null,"container":{"type":"table","append":"<\/div>;","prepend":"
","gutters":true,"items-per-page":30,"items-per-row":4},"delete":1,"filter":null,"options":null,"created_at":"2026-07-06 19:32:46"}, render: [{"name":"id","label":"Id","type":"text","hint":"This field show [Id]","active":false,"PK":true},{"name":"name","label":"Name","type":"text","hint":"This field show [Name]","active":true},{"name":"description","label":"Description","type":"text","hint":"This field show [Description]","active":true},{"name":"variables","label":"Variables","type":"text","hint":"This field show [Variables]","active":false},{"name":"props","label":"Props","type":"text","hint":"This field show [Props]","active":false},{"name":"template","label":"Template","type":"text","hint":"This field show [Template]","active":false},{"name":"method","label":"Method","type":"text","hint":"This field show [Method]","active":false},{"name":"created","label":"Created","type":"text","hint":"This field show [Created]","active":false},{"name":"mounted","label":"Mounted","type":"text","hint":"This field show [Mounted]","active":false},{"name":"watch","label":"Watch","type":"text","hint":"This field show [Watch]","active":false},{"name":"computed","label":"Computed","type":"text","hint":"This field show [Computed]","active":false},{"name":"created_at","label":"Created At","type":"date","hint":"This field show [Created At]","active":true}], posible_fields: {"name":null,"description":null,"created_at":null}, local_filter:{}, search:null, remove:null, pin:this.$pin(6), pin_verify:null, helpers:{ loading:false, page:1 }, inner_filter:{ search:null, limit:30, page:1 }, _skipWatch: false, timer:null }; }, props: { allow: { type: Array, default: () => [] }, attrs: { type: Object, default: () => {} }, inline:{ type: Boolean, default: false }, admin:{ type: Boolean, default: true }, binds: { type: Object, default: () => {} }, received_values: { type: Object, default: () => {} }, filter: { type: Object, default: () => {} }, ID: { type: String, required:false }, }, watch:{ binds: { handler(newValue, oldValue) { this.local_filter = { ...this.binds, ...this.received_values } }, immediate: false, // Ejecutar inmediatamente deep: true // Usar true si es un objeto/array }, received_values: { handler(newValue, oldValue) { this.local_filter = { ...this.binds, ...this.received_values } }, immediate: false, // Ejecutar inmediatamente deep: true // Usar true si es un objeto/array }, local_filter: { handler(newValue, oldValue) { if(this.helpers.loading==false){ this.Get() } }, immediate: false, // Ejecutar inmediatamente deep: true // Usar true si es un objeto/array }, ...['search', 'limit', 'sort', 'order', 'trashed', 'scope', 'date_from', 'date_to'].reduce((acc, field) => { acc[`inner_filter.${field}`] = function() { this.inner_filter.page = 1; }; return acc; }, {}), inner_filter: { inmediate:true, deep:true, handler(newId){ clearTimeout(this.timer) this.timer = setTimeout(()=>{ this.onSearch() },500) } } }, computed:{ render_header(){ let header = [] if (this.render.length>0) { this.render.forEach((field)=>{ if (field.active==='true' || field.active===true) { header.push({... { align:'start', key: field.name, sortable: true, title: field.label, } }); } }) } else { if(this.data && this.data.length>0){ header = Object.keys(this.data[0]).map(key => ({ align:'start', key: key, sortable: true, title: key.charAt(0).toUpperCase() + key.slice(1), })); } } header.push({... { align:'end', key: 'render_table_actions', sortable: false, title: '...', } }) return header }, pagination_length(){ if (!this.data) return 0; let total = this.data.count <= this.data.total ? this.data.total:this.data.count return Math.ceil(total/this.inner_filter.limit) } }, methods: { async Get(filter={}){ this.helpers.loading = true const promise = await this.$you.find('sys_data_components',filter) if(promise.status == 200){ this.data = promise?.data ?? [] } this.helpers.loading = false }, onSearch() { let search = new URLSearchParams(window.location.search) let filter = { ...search, ...this.binds, ...this.inner_filter} this.Get(filter) }, async Remove() { const promise = await axios.get('/api/sys_data_components/'+this.remove+'/remove'); if (promise.status==200) { this.remove = null this.pin = this.$pin(6) this.pin_verify = null this.Get() } }, async getPalette(img,item){ item['palette'] = await this.$colorPalette.getDominantColor(img) this.getContrastColor(item.palette,item) }, getContrastColor(color,item){ const contrastWithWhite = this.$colorPalette.getContrastRatio(color, '#FFFFFF') const contrastWithBlack = this.$colorPalette.getContrastRatio(color, '#000000') item['contrast'] = contrastWithWhite > contrastWithBlack ? '#FFFFFF' : '#000000' }, downloadFile(name,content){ const parts = content.split(',') if(parts.length !== 2){ alert('Invalid File') return } const typeBase64 = parts[0] const contentBase64 = parts[1] const typeMIME = typeBase64.split(';')[0].replace('data:','') const byteCharacters = atob(contentBase64) const byteNumbers = new Array(byteCharacters.length) for (let i = 0; i < byteCharacters.length; i++) { byteNumbers[i] = byteCharacters.charCodeAt(i) } const byteArray = new Uint8Array(byteNumbers) const blob = new Blob([byteArray],{type:typeMIME}) const link = document.createElement('a') link.href = URL.createObjectURL(blob) link.download = name document.body.appendChild(link) link.click() document.body.removeChild(link) }, }, mounted(){ this.onSearch() }, created(){ }, }; window.componentes.BaseSysDataComponentList = BaseSysDataComponentList; const BaseSysDataMethodList = { template: `

ph-duotone ph-list-bullets Bricks

mdi-format-text Table mdi-format-text Name mdi-format-text Description mdi-format-text Method Type Created At mdi-dots-vertical-circle-outline mdi-dots-vertical-circle-outline
{{btn.icon || 'mdi-pointer'}} {{btn.title||'Custom Action'}}
{{btn.icon || 'mdi-pointer'}} {{btn.title||'Custom Action'}}
Details Update Delete
Show {{n*30}} Of {{data?.total ?? 0}} Eliminar Registro Ingrese el codigo: {{pin}} Eliminar Cerrar
`, data() { return { data:[], brick:{"id":"base_sys_data_method_list","owner":null,"table":"sys_data_method","name":"Bricks","description":null,"method":"get","type":"all","fields":[{"name":"id","label":"Id","type":"text","hint":"This field show Id","active":false,"PK":true},{"name":"owner","label":"Owner","type":"text","hint":"This field show Owner","active":false},{"name":"table","label":"Table","type":"text","hint":"This field show Table","active":true},{"name":"name","label":"Name","type":"text","hint":"This field show Name","active":true},{"name":"description","label":"Description","type":"text","hint":"This field show Description","active":true},{"name":"method","label":"Method","type":"text","hint":"This field show Method","active":true},{"name":"type","label":"Type","type":"date","hint":"This field show Type","active":true},{"name":"fields","label":"Fields","type":"text","hint":"This field show Fields","active":false},{"name":"template","label":"Template","type":"text","hint":"This field show Template","active":false},{"name":"custom_template","label":"Custom Template","type":"text","hint":"This field show Custom Template","active":false},{"name":"custom_functions","label":"Custom Functions","type":"text","hint":"This field show Custom Functions","active":false},{"name":"container","label":"Container","type":"text","hint":"This field show Container","active":false},{"name":"delete","label":"Delete","type":"number","hint":"This field show Delete","active":false},{"name":"filter","label":"Filter","type":"text","hint":"This field show Filter","active":false},{"name":"options","label":"Options","type":"text","hint":"This field show Options","active":false},{"name":"created_at","label":"Created At","type":"date","hint":"This field show Created At","active":true}],"template":null,"custom_template":null,"custom_functions":null,"container":{"type":"table","append":"<\/div>;","prepend":"
","gutters":true,"items-per-page":30,"items-per-row":4},"delete":1,"filter":null,"options":null,"created_at":"2026-07-06 15:26:34"}, render: [{"name":"id","label":"Id","type":"text","hint":"This field show Id","active":false,"PK":true},{"name":"owner","label":"Owner","type":"text","hint":"This field show Owner","active":false},{"name":"table","label":"Table","type":"text","hint":"This field show Table","active":true},{"name":"name","label":"Name","type":"text","hint":"This field show Name","active":true},{"name":"description","label":"Description","type":"text","hint":"This field show Description","active":true},{"name":"method","label":"Method","type":"text","hint":"This field show Method","active":true},{"name":"type","label":"Type","type":"date","hint":"This field show Type","active":true},{"name":"fields","label":"Fields","type":"text","hint":"This field show Fields","active":false},{"name":"template","label":"Template","type":"text","hint":"This field show Template","active":false},{"name":"custom_template","label":"Custom Template","type":"text","hint":"This field show Custom Template","active":false},{"name":"custom_functions","label":"Custom Functions","type":"text","hint":"This field show Custom Functions","active":false},{"name":"container","label":"Container","type":"text","hint":"This field show Container","active":false},{"name":"delete","label":"Delete","type":"number","hint":"This field show Delete","active":false},{"name":"filter","label":"Filter","type":"text","hint":"This field show Filter","active":false},{"name":"options","label":"Options","type":"text","hint":"This field show Options","active":false},{"name":"created_at","label":"Created At","type":"date","hint":"This field show Created At","active":true}], posible_fields: {"table":null,"name":null,"description":null,"method":null,"type":null,"created_at":null}, local_filter:{}, search:null, remove:null, pin:this.$pin(6), pin_verify:null, helpers:{ loading:false, page:1 }, inner_filter:{ search:null, limit:30, page:1 }, _skipWatch: false, timer:null }; }, props: { allow: { type: Array, default: () => [] }, attrs: { type: Object, default: () => {} }, inline:{ type: Boolean, default: false }, admin:{ type: Boolean, default: true }, binds: { type: Object, default: () => {} }, received_values: { type: Object, default: () => {} }, filter: { type: Object, default: () => {} }, ID: { type: String, required:false }, }, watch:{ binds: { handler(newValue, oldValue) { this.local_filter = { ...this.binds, ...this.received_values } }, immediate: false, // Ejecutar inmediatamente deep: true // Usar true si es un objeto/array }, received_values: { handler(newValue, oldValue) { this.local_filter = { ...this.binds, ...this.received_values } }, immediate: false, // Ejecutar inmediatamente deep: true // Usar true si es un objeto/array }, local_filter: { handler(newValue, oldValue) { if(this.helpers.loading==false){ this.Get() } }, immediate: false, // Ejecutar inmediatamente deep: true // Usar true si es un objeto/array }, ...['search', 'limit', 'sort', 'order', 'trashed', 'scope', 'date_from', 'date_to'].reduce((acc, field) => { acc[`inner_filter.${field}`] = function() { this.inner_filter.page = 1; }; return acc; }, {}), inner_filter: { inmediate:true, deep:true, handler(newId){ clearTimeout(this.timer) this.timer = setTimeout(()=>{ this.onSearch() },500) } } }, computed:{ render_header(){ let header = [] if (this.render.length>0) { this.render.forEach((field)=>{ if (field.active==='true' || field.active===true) { header.push({... { align:'start', key: field.name, sortable: true, title: field.label, } }); } }) } else { if(this.data && this.data.length>0){ header = Object.keys(this.data[0]).map(key => ({ align:'start', key: key, sortable: true, title: key.charAt(0).toUpperCase() + key.slice(1), })); } } header.push({... { align:'end', key: 'render_table_actions', sortable: false, title: '...', } }) return header }, pagination_length(){ if (!this.data) return 0; let total = this.data.count <= this.data.total ? this.data.total:this.data.count return Math.ceil(total/this.inner_filter.limit) } }, methods: { async Get(filter={}){ this.helpers.loading = true const promise = await this.$you.find('sys_data_method',filter) if(promise.status == 200){ this.data = promise?.data ?? [] } this.helpers.loading = false }, onSearch() { let search = new URLSearchParams(window.location.search) let filter = { ...search, ...this.binds, ...this.inner_filter} this.Get(filter) }, async Remove() { const promise = await axios.get('/api/sys_data_method/'+this.remove+'/remove'); if (promise.status==200) { this.remove = null this.pin = this.$pin(6) this.pin_verify = null this.Get() } }, async getPalette(img,item){ item['palette'] = await this.$colorPalette.getDominantColor(img) this.getContrastColor(item.palette,item) }, getContrastColor(color,item){ const contrastWithWhite = this.$colorPalette.getContrastRatio(color, '#FFFFFF') const contrastWithBlack = this.$colorPalette.getContrastRatio(color, '#000000') item['contrast'] = contrastWithWhite > contrastWithBlack ? '#FFFFFF' : '#000000' }, downloadFile(name,content){ const parts = content.split(',') if(parts.length !== 2){ alert('Invalid File') return } const typeBase64 = parts[0] const contentBase64 = parts[1] const typeMIME = typeBase64.split(';')[0].replace('data:','') const byteCharacters = atob(contentBase64) const byteNumbers = new Array(byteCharacters.length) for (let i = 0; i < byteCharacters.length; i++) { byteNumbers[i] = byteCharacters.charCodeAt(i) } const byteArray = new Uint8Array(byteNumbers) const blob = new Blob([byteArray],{type:typeMIME}) const link = document.createElement('a') link.href = URL.createObjectURL(blob) link.download = name document.body.appendChild(link) link.click() document.body.removeChild(link) }, }, mounted(){ this.onSearch() }, created(){ }, }; window.componentes.BaseSysDataMethodList = BaseSysDataMethodList; const BaseSysDataRenderList = { template: `

ph-duotone ph-list-bullets Pages

Pages Lists

mdi-format-text Id mdi-format-text Type mdi-format-text Name mdi-format-text Description mdi-format-text Created At mdi-dots-vertical-circle-outline NO PK Show {{n*25}} Of {{data?.total ?? 0}} Eliminar Registro Ingrese el codigo: {{pin}} Eliminar Cerrar
`, data() { return { data:[], brick:{"id":"base_sys_data_render_list","owner":null,"table":"sys_data_render","name":"Pages","description":"Pages Lists","method":"get","type":"all","fields":[{"hint":"Id","name":"id","type":"text","label":"Id","active":true},{"hint":"Owner","name":"owner","type":"text","label":"Owner","active":false},{"hint":"Type","name":"type","type":"text","label":"Type","active":true},{"hint":"Name","name":"name","type":"text","label":"Name","active":true},{"hint":"Description","name":"description","type":"text","label":"Description","active":true},{"hint":"Structure","name":"structure","type":"text","label":"Structure","active":false},{"hint":"Template","name":"template","type":"text","label":"Template","active":false},{"hint":"Custom Template","name":"custom_template","type":"text","label":"Custom Template","active":false},{"hint":"Container","name":"container","type":"text","label":"Container","active":false},{"hint":"Created At","name":"created_at","type":"text","label":"Created At","active":true}],"template":null,"custom_template":null,"custom_functions":null,"container":{"type":"table","append":"<\/div>","prepend":"
"},"delete":1,"filter":{"progress":"DESC"},"options":null,"created_at":"2025-11-20 06:58:51"}, render: [{"hint":"Id","name":"id","type":"text","label":"Id","active":true},{"hint":"Owner","name":"owner","type":"text","label":"Owner","active":false},{"hint":"Type","name":"type","type":"text","label":"Type","active":true},{"hint":"Name","name":"name","type":"text","label":"Name","active":true},{"hint":"Description","name":"description","type":"text","label":"Description","active":true},{"hint":"Structure","name":"structure","type":"text","label":"Structure","active":false},{"hint":"Template","name":"template","type":"text","label":"Template","active":false},{"hint":"Custom Template","name":"custom_template","type":"text","label":"Custom Template","active":false},{"hint":"Container","name":"container","type":"text","label":"Container","active":false},{"hint":"Created At","name":"created_at","type":"text","label":"Created At","active":true}], posible_fields: {"id":null,"type":null,"name":null,"description":null,"created_at":null}, local_filter:{}, search:null, remove:null, pin:this.$pin(6), pin_verify:null, helpers:{ loading:false, page:1 }, inner_filter:{ search:null, limit:25, page:1 }, _skipWatch: false, timer:null }; }, props: { allow: { type: Array, default: () => [] }, attrs: { type: Object, default: () => {} }, inline:{ type: Boolean, default: false }, admin:{ type: Boolean, default: true }, binds: { type: Object, default: () => {} }, received_values: { type: Object, default: () => {} }, filter: { type: Object, default: () => {} }, ID: { type: String, required:false }, }, watch:{ binds: { handler(newValue, oldValue) { this.local_filter = { ...this.binds, ...this.received_values } }, immediate: false, // Ejecutar inmediatamente deep: true // Usar true si es un objeto/array }, received_values: { handler(newValue, oldValue) { this.local_filter = { ...this.binds, ...this.received_values } }, immediate: false, // Ejecutar inmediatamente deep: true // Usar true si es un objeto/array }, local_filter: { handler(newValue, oldValue) { if(this.helpers.loading==false){ this.Get() } }, immediate: false, // Ejecutar inmediatamente deep: true // Usar true si es un objeto/array }, ...['search', 'limit', 'sort', 'order', 'trashed', 'scope', 'date_from', 'date_to'].reduce((acc, field) => { acc[`inner_filter.${field}`] = function() { this.inner_filter.page = 1; }; return acc; }, {}), inner_filter: { inmediate:true, deep:true, handler(newId){ clearTimeout(this.timer) this.timer = setTimeout(()=>{ this.onSearch() },500) } } }, computed:{ render_header(){ let header = [] if (this.render.length>0) { this.render.forEach((field)=>{ if (field.active==='true' || field.active===true) { header.push({... { align:'start', key: field.name, sortable: true, title: field.label, } }); } }) } else { if(this.data && this.data.length>0){ header = Object.keys(this.data[0]).map(key => ({ align:'start', key: key, sortable: true, title: key.charAt(0).toUpperCase() + key.slice(1), })); } } header.push({... { align:'end', key: 'render_table_actions', sortable: false, title: '...', } }) return header }, pagination_length(){ if (!this.data) return 0; let total = this.data.count <= this.data.total ? this.data.total:this.data.count return Math.ceil(total/this.inner_filter.limit) } }, methods: { async Get(filter={}){ this.helpers.loading = true const promise = await this.$you.find('sys_data_render',filter) if(promise.status == 200){ this.data = promise?.data ?? [] } this.helpers.loading = false }, onSearch() { let search = new URLSearchParams(window.location.search) let filter = { ...search, ...this.binds, ...this.inner_filter} this.Get(filter) }, async Remove() { const promise = await axios.get('/api/sys_data_render/'+this.remove+'/remove'); if (promise.status==200) { this.remove = null this.pin = this.$pin(6) this.pin_verify = null this.Get() } }, async getPalette(img,item){ item['palette'] = await this.$colorPalette.getDominantColor(img) this.getContrastColor(item.palette,item) }, getContrastColor(color,item){ const contrastWithWhite = this.$colorPalette.getContrastRatio(color, '#FFFFFF') const contrastWithBlack = this.$colorPalette.getContrastRatio(color, '#000000') item['contrast'] = contrastWithWhite > contrastWithBlack ? '#FFFFFF' : '#000000' }, downloadFile(name,content){ const parts = content.split(',') if(parts.length !== 2){ alert('Invalid File') return } const typeBase64 = parts[0] const contentBase64 = parts[1] const typeMIME = typeBase64.split(';')[0].replace('data:','') const byteCharacters = atob(contentBase64) const byteNumbers = new Array(byteCharacters.length) for (let i = 0; i < byteCharacters.length; i++) { byteNumbers[i] = byteCharacters.charCodeAt(i) } const byteArray = new Uint8Array(byteNumbers) const blob = new Blob([byteArray],{type:typeMIME}) const link = document.createElement('a') link.href = URL.createObjectURL(blob) link.download = name document.body.appendChild(link) link.click() document.body.removeChild(link) }, }, mounted(){ this.onSearch() }, created(){ }, }; window.componentes.BaseSysDataRenderList = BaseSysDataRenderList; const BaseSysUsersList = { template: `

ph-duotone ph-list-bullets Users List

mdi-format-text Code mdi-format-text Fullname mdi-format-text Position mdi-format-text Role mdi-format-text Is Active mdi-format-text Created At mdi-dots-vertical-circle-outline NO PK Show {{n*25}} Of {{data?.total ?? 0}} Eliminar Registro Ingrese el codigo: {{pin}} Eliminar Cerrar
`, data() { return { data:[], brick:{"id":"base_sys_users_list","owner":null,"table":"sys_users","name":"Users List","description":null,"method":"get","type":"all","fields":[{"hint":"Id","name":"id","type":"text","label":"Id","active":false},{"hint":"Owner","name":"owner","type":"text","label":"Owner","active":false},{"hint":"Parent","name":"parent","type":"text","label":"Parent","active":false},{"hint":"Code","name":"code","type":"text","label":"Code","active":true},{"hint":"Fullname","name":"fullname","type":"text","label":"Fullname","active":true},{"hint":"Position","name":"position","type":"text","label":"Position","active":true},{"hint":"Email","name":"email","type":"text","label":"Email","active":false},{"hint":"Phone","name":"phone","type":"text","label":"Phone","active":false},{"hint":"Password","name":"password","type":"text","label":"Password","active":false},{"hint":"Role","name":"role","type":"text","label":"Role","active":true},{"hint":"Bio","name":"bio","type":"text","label":"Bio","active":false},{"hint":"Birthday","name":"birthday","type":"text","label":"Birthday","active":false},{"hint":"Is Active","name":"is_active","type":"text","label":"Is Active","active":true},{"hint":"Created At","name":"created_at","type":"text","label":"Created At","active":true},{"hint":"Updated At","name":"updated_at","type":"text","label":"Updated At","active":false},{"hint":"Token","name":"token","type":"text","label":"Token","active":false}],"template":null,"custom_template":null,"custom_functions":null,"container":{"type":"table","append":"
","prepend":"
"},"delete":1,"filter":{"progress":"DESC"},"options":null,"created_at":"2025-11-19 12:18:20"}, render: [{"hint":"Id","name":"id","type":"text","label":"Id","active":false},{"hint":"Owner","name":"owner","type":"text","label":"Owner","active":false},{"hint":"Parent","name":"parent","type":"text","label":"Parent","active":false},{"hint":"Code","name":"code","type":"text","label":"Code","active":true},{"hint":"Fullname","name":"fullname","type":"text","label":"Fullname","active":true},{"hint":"Position","name":"position","type":"text","label":"Position","active":true},{"hint":"Email","name":"email","type":"text","label":"Email","active":false},{"hint":"Phone","name":"phone","type":"text","label":"Phone","active":false},{"hint":"Password","name":"password","type":"text","label":"Password","active":false},{"hint":"Role","name":"role","type":"text","label":"Role","active":true},{"hint":"Bio","name":"bio","type":"text","label":"Bio","active":false},{"hint":"Birthday","name":"birthday","type":"text","label":"Birthday","active":false},{"hint":"Is Active","name":"is_active","type":"text","label":"Is Active","active":true},{"hint":"Created At","name":"created_at","type":"text","label":"Created At","active":true},{"hint":"Updated At","name":"updated_at","type":"text","label":"Updated At","active":false},{"hint":"Token","name":"token","type":"text","label":"Token","active":false}], posible_fields: {"code":null,"fullname":null,"position":null,"role":null,"is_active":null,"created_at":null}, local_filter:{}, search:null, remove:null, pin:this.$pin(6), pin_verify:null, helpers:{ loading:false, page:1 }, inner_filter:{ search:null, limit:25, page:1 }, _skipWatch: false, timer:null }; }, props: { allow: { type: Array, default: () => [] }, attrs: { type: Object, default: () => {} }, inline:{ type: Boolean, default: false }, admin:{ type: Boolean, default: true }, binds: { type: Object, default: () => {} }, received_values: { type: Object, default: () => {} }, filter: { type: Object, default: () => {} }, ID: { type: String, required:false }, }, watch:{ binds: { handler(newValue, oldValue) { this.local_filter = { ...this.binds, ...this.received_values } }, immediate: false, // Ejecutar inmediatamente deep: true // Usar true si es un objeto/array }, received_values: { handler(newValue, oldValue) { this.local_filter = { ...this.binds, ...this.received_values } }, immediate: false, // Ejecutar inmediatamente deep: true // Usar true si es un objeto/array }, local_filter: { handler(newValue, oldValue) { if(this.helpers.loading==false){ this.Get() } }, immediate: false, // Ejecutar inmediatamente deep: true // Usar true si es un objeto/array }, ...['search', 'limit', 'sort', 'order', 'trashed', 'scope', 'date_from', 'date_to'].reduce((acc, field) => { acc[`inner_filter.${field}`] = function() { this.inner_filter.page = 1; }; return acc; }, {}), inner_filter: { inmediate:true, deep:true, handler(newId){ clearTimeout(this.timer) this.timer = setTimeout(()=>{ this.onSearch() },500) } } }, computed:{ render_header(){ let header = [] if (this.render.length>0) { this.render.forEach((field)=>{ if (field.active==='true' || field.active===true) { header.push({... { align:'start', key: field.name, sortable: true, title: field.label, } }); } }) } else { if(this.data && this.data.length>0){ header = Object.keys(this.data[0]).map(key => ({ align:'start', key: key, sortable: true, title: key.charAt(0).toUpperCase() + key.slice(1), })); } } header.push({... { align:'end', key: 'render_table_actions', sortable: false, title: '...', } }) return header }, pagination_length(){ if (!this.data) return 0; let total = this.data.count <= this.data.total ? this.data.total:this.data.count return Math.ceil(total/this.inner_filter.limit) } }, methods: { async Get(filter={}){ this.helpers.loading = true const promise = await this.$you.find('sys_users',filter) if(promise.status == 200){ this.data = promise?.data ?? [] } this.helpers.loading = false }, onSearch() { let search = new URLSearchParams(window.location.search) let filter = { ...search, ...this.binds, ...this.inner_filter} this.Get(filter) }, async Remove() { const promise = await axios.get('/api/sys_users/'+this.remove+'/remove'); if (promise.status==200) { this.remove = null this.pin = this.$pin(6) this.pin_verify = null this.Get() } }, async getPalette(img,item){ item['palette'] = await this.$colorPalette.getDominantColor(img) this.getContrastColor(item.palette,item) }, getContrastColor(color,item){ const contrastWithWhite = this.$colorPalette.getContrastRatio(color, '#FFFFFF') const contrastWithBlack = this.$colorPalette.getContrastRatio(color, '#000000') item['contrast'] = contrastWithWhite > contrastWithBlack ? '#FFFFFF' : '#000000' }, downloadFile(name,content){ const parts = content.split(',') if(parts.length !== 2){ alert('Invalid File') return } const typeBase64 = parts[0] const contentBase64 = parts[1] const typeMIME = typeBase64.split(';')[0].replace('data:','') const byteCharacters = atob(contentBase64) const byteNumbers = new Array(byteCharacters.length) for (let i = 0; i < byteCharacters.length; i++) { byteNumbers[i] = byteCharacters.charCodeAt(i) } const byteArray = new Uint8Array(byteNumbers) const blob = new Blob([byteArray],{type:typeMIME}) const link = document.createElement('a') link.href = URL.createObjectURL(blob) link.download = name document.body.appendChild(link) link.click() document.body.removeChild(link) }, }, mounted(){ this.onSearch() }, created(){ }, }; window.componentes.BaseSysUsersList = BaseSysUsersList; const BaseSysUsersView = { template: `

ph-duotone ph-article Users View

Eliminar Registro Ingrese el codigo: {{pin}} Eliminar Cerrar `, data() { return { data:{"id":null,"owner":null,"parent":null,"code":null,"fullname":null,"position":null,"email":null,"phone":null,"password":null,"role":null,"bio":null,"birthday":null,"is_active":null,"created_at":null,"updated_at":null,"token":null}, brick:{"id":"base_sys_users_view","owner":null,"table":"sys_users","name":"Users View","description":null,"method":"get","type":"first","fields":[{"hint":"Id","name":"id","type":"text","label":"Id","active":true},{"hint":"Owner","name":"owner","type":"text","label":"Owner","active":true},{"hint":"Parent","name":"parent","type":"text","label":"Parent","active":true},{"hint":"Code","name":"code","type":"text","label":"Code","active":true},{"hint":"Fullname","name":"fullname","type":"text","label":"Fullname","active":true},{"hint":"Position","name":"position","type":"text","label":"Position","active":true},{"hint":"Email","name":"email","type":"text","label":"Email","active":true},{"hint":"Phone","name":"phone","type":"text","label":"Phone","active":true},{"hint":"Password","name":"password","type":"text","label":"Password","active":true},{"hint":"Role","name":"role","type":"text","label":"Role","active":true},{"hint":"Bio","name":"bio","type":"text","label":"Bio","active":true},{"hint":"Birthday","name":"birthday","type":"text","label":"Birthday","active":true},{"hint":"Is Active","name":"is_active","type":"text","label":"Is Active","active":true},{"hint":"Created At","name":"created_at","type":"text","label":"Created At","active":true},{"hint":"Updated At","name":"updated_at","type":"text","label":"Updated At","active":true},{"hint":"Token","name":"token","type":"text","label":"Token","active":true}],"template":null,"custom_template":null,"custom_functions":null,"container":{"type":"grid","append":"
","prepend":"
"},"delete":1,"filter":{"progress":"DESC"},"options":null,"created_at":"2025-11-19 11:18:20"}, render: [{"hint":"Id","name":"id","type":"text","label":"Id","active":true},{"hint":"Owner","name":"owner","type":"text","label":"Owner","active":true},{"hint":"Parent","name":"parent","type":"text","label":"Parent","active":true},{"hint":"Code","name":"code","type":"text","label":"Code","active":true},{"hint":"Fullname","name":"fullname","type":"text","label":"Fullname","active":true},{"hint":"Position","name":"position","type":"text","label":"Position","active":true},{"hint":"Email","name":"email","type":"text","label":"Email","active":true},{"hint":"Phone","name":"phone","type":"text","label":"Phone","active":true},{"hint":"Password","name":"password","type":"text","label":"Password","active":true},{"hint":"Role","name":"role","type":"text","label":"Role","active":true},{"hint":"Bio","name":"bio","type":"text","label":"Bio","active":true},{"hint":"Birthday","name":"birthday","type":"text","label":"Birthday","active":true},{"hint":"Is Active","name":"is_active","type":"text","label":"Is Active","active":true},{"hint":"Created At","name":"created_at","type":"text","label":"Created At","active":true},{"hint":"Updated At","name":"updated_at","type":"text","label":"Updated At","active":true},{"hint":"Token","name":"token","type":"text","label":"Token","active":true}], posible_fields: {"id":null,"owner":null,"parent":null,"code":null,"fullname":null,"position":null,"email":null,"phone":null,"password":null,"role":null,"bio":null,"birthday":null,"is_active":null,"created_at":null,"updated_at":null,"token":null}, local_filter:{}, search:null, remove:null, pin:this.$pin(6), pin_verify:null, helpers:{ loading:false, page:1 }, inner_filter:{ search:null, limit:25, page:1 }, _skipWatch: false, timer:null }; }, props: { allow: { type: Array, default: () => [] }, attrs: { type: Object, default: () => {} }, inline:{ type: Boolean, default: false }, admin:{ type: Boolean, default: true }, binds: { type: Object, default: () => {} }, received_values: { type: Object, default: () => {} }, filter: { type: Object, default: () => {} }, ID: { type: String, required:false }, }, watch:{ binds: { handler(newValue, oldValue) { this.local_filter = { ...this.binds, ...this.received_values } }, immediate: false, // Ejecutar inmediatamente deep: true // Usar true si es un objeto/array }, received_values: { handler(newValue, oldValue) { this.local_filter = { ...this.binds, ...this.received_values } }, immediate: false, // Ejecutar inmediatamente deep: true // Usar true si es un objeto/array }, local_filter: { handler(newValue, oldValue) { if(this.helpers.loading==false){ this.Get() } }, immediate: false, // Ejecutar inmediatamente deep: true // Usar true si es un objeto/array }, ...['search', 'limit', 'sort', 'order', 'trashed', 'scope', 'date_from', 'date_to'].reduce((acc, field) => { acc[`inner_filter.${field}`] = function() { this.inner_filter.page = 1; }; return acc; }, {}), inner_filter: { inmediate:true, deep:true, handler(newId){ clearTimeout(this.timer) this.timer = setTimeout(()=>{ this.onSearch() },500) } } }, computed:{ render_header(){ let header = [] if (this.render.length>0) { this.render.forEach((field)=>{ if (field.active==='true' || field.active===true) { header.push({... { align:'start', key: field.name, sortable: true, title: field.label, } }); } }) } else { if(this.data && this.data.length>0){ header = Object.keys(this.data[0]).map(key => ({ align:'start', key: key, sortable: true, title: key.charAt(0).toUpperCase() + key.slice(1), })); } } header.push({... { align:'end', key: 'render_table_actions', sortable: false, title: '...', } }) return header }, pagination_length(){ if (!this.data) return 0; let total = this.data.count <= this.data.total ? this.data.total:this.data.count return Math.ceil(total/this.inner_filter.limit) } }, methods: { async Get(filter={}){ this.helpers.loading = true let get_id = this.ID?this.ID:this.$root.url.param const promise = await this.$you.find('sys_users',{ id:get_id }); if (promise.status==200) { this.data = promise.data?.data?.[0] ?? {} } this.helpers.loading = false }, onSearch() { let search = new URLSearchParams(window.location.search) let filter = { ...search, ...this.binds, ...this.inner_filter} this.Get(filter) }, async Remove() { const promise = await axios.get('/api/sys_users/'+this.remove+'/remove'); if (promise.status==200) { this.remove = null this.pin = this.$pin(6) this.pin_verify = null this.Get() } }, async getPalette(img,item){ item['palette'] = await this.$colorPalette.getDominantColor(img) this.getContrastColor(item.palette,item) }, getContrastColor(color,item){ const contrastWithWhite = this.$colorPalette.getContrastRatio(color, '#FFFFFF') const contrastWithBlack = this.$colorPalette.getContrastRatio(color, '#000000') item['contrast'] = contrastWithWhite > contrastWithBlack ? '#FFFFFF' : '#000000' }, downloadFile(name,content){ const parts = content.split(',') if(parts.length !== 2){ alert('Invalid File') return } const typeBase64 = parts[0] const contentBase64 = parts[1] const typeMIME = typeBase64.split(';')[0].replace('data:','') const byteCharacters = atob(contentBase64) const byteNumbers = new Array(byteCharacters.length) for (let i = 0; i < byteCharacters.length; i++) { byteNumbers[i] = byteCharacters.charCodeAt(i) } const byteArray = new Uint8Array(byteNumbers) const blob = new Blob([byteArray],{type:typeMIME}) const link = document.createElement('a') link.href = URL.createObjectURL(blob) link.download = name document.body.appendChild(link) link.click() document.body.removeChild(link) }, }, mounted(){ this.onSearch() }, created(){ }, }; window.componentes.BaseSysUsersView = BaseSysUsersView; const EvaluationsList = { template: `

ph-duotone ph-list-bullets Evaluaciones

mdi-format-text Name mdi-format-text Description Max Score Due Date mdi-format-text Status mdi-format-text Subject Id Name mdi-format-text Period Id Name mdi-dots-vertical-circle-outline mdi-dots-vertical-circle-outline
{{btn.icon || 'mdi-pointer'}} {{btn.title||'Custom Action'}}
{{btn.icon || 'mdi-pointer'}} {{btn.title||'Custom Action'}}
Details Update Delete
Show {{n*30}} Of {{data?.total ?? 0}} Eliminar Registro Ingrese el codigo: {{pin}} Eliminar Cerrar
`, data() { return { data:[], brick:{"id":"evaluations_list","owner":null,"table":"evaluations","name":"Evaluaciones","description":null,"method":"get","type":"all","fields":[{"name":"id","label":"Id","type":"text","hint":"This field show Id","active":false,"PK":true},{"name":"subject_id","label":"Subject Id","type":"relation","hint":"This field show Subject Id","active":false},{"name":"period_id","label":"Period Id","type":"relation","hint":"This field show Period Id","active":false},{"name":"name","label":"Name","type":"text","hint":"This field show Name","active":true},{"name":"description","label":"Description","type":"text","hint":"This field show Description","active":true},{"name":"max_score","label":"Max Score","type":"number","hint":"This field show Max Score","active":true},{"name":"weight_percentage","label":"Weight Percentage","type":"number","hint":"This field show Weight Percentage","active":false},{"name":"due_date","label":"Due Date","type":"date","hint":"This field show Due Date","active":true},{"name":"status","label":"Status","type":"text","hint":"This field show Status","active":true},{"name":"created_at","label":"Created At","type":"date","hint":"This field show Created At","active":false},{"name":"updated_at","label":"Updated At","type":"date","hint":"This field show Updated At","active":false},{"name":"subject_id__id","label":"Subject Id Id","type":"text","hint":"This field show [Subject Id Id]","active":false,"PK":true},{"name":"subject_id__code","label":"Subject Id Code","type":"text","hint":"This field show [Subject Id Code]","active":false},{"name":"subject_id__name","label":"Subject Id Name","type":"text","hint":"This field show [Subject Id Name]","active":true},{"name":"subject_id__description","label":"Subject Id Description","type":"text","hint":"This field show [Subject Id Description]","active":false},{"name":"subject_id__max_score","label":"Subject Id Max Score","type":"number","hint":"This field show [Subject Id Max Score]","active":false},{"name":"subject_id__status","label":"Subject Id Status","type":"text","hint":"This field show [Subject Id Status]","active":false},{"name":"subject_id__created_at","label":"Subject Id Created At","type":"date","hint":"This field show [Subject Id Created At]","active":false},{"name":"subject_id__updated_at","label":"Subject Id Updated At","type":"date","hint":"This field show [Subject Id Updated At]","active":false},{"name":"period_id__id","label":"Period Id Id","type":"text","hint":"This field show [Period Id Id]","active":false,"PK":true},{"name":"period_id__school_year_id","label":"Period Id School Year Id","type":"text","hint":"This field show [Period Id School Year Id]","active":false},{"name":"period_id__name","label":"Period Id Name","type":"text","hint":"This field show [Period Id Name]","active":true},{"name":"period_id__code","label":"Period Id Code","type":"text","hint":"This field show [Period Id Code]","active":false},{"name":"period_id__number","label":"Period Id Number","type":"number","hint":"This field show [Period Id Number]","active":false},{"name":"period_id__start_date","label":"Period Id Start Date","type":"date","hint":"This field show [Period Id Start Date]","active":false},{"name":"period_id__end_date","label":"Period Id End Date","type":"date","hint":"This field show [Period Id End Date]","active":false},{"name":"period_id__weight_percentage","label":"Period Id Weight Percentage","type":"number","hint":"This field show [Period Id Weight Percentage]","active":false},{"name":"period_id__status","label":"Period Id Status","type":"text","hint":"This field show [Period Id Status]","active":false},{"name":"period_id__created_at","label":"Period Id Created At","type":"date","hint":"This field show [Period Id Created At]","active":false},{"name":"period_id__updated_at","label":"Period Id Updated At","type":"date","hint":"This field show [Period Id Updated At]","active":false}],"template":[],"custom_template":null,"custom_functions":null,"container":{"type":"table","append":"<\/div>;","prepend":"
","gutters":true,"items-per-page":30,"items-per-row":4},"delete":1,"filter":null,"options":null,"created_at":"2026-07-06 16:16:05"}, render: [{"name":"id","label":"Id","type":"text","hint":"This field show Id","active":false,"PK":true},{"name":"subject_id","label":"Subject Id","type":"relation","hint":"This field show Subject Id","active":false},{"name":"period_id","label":"Period Id","type":"relation","hint":"This field show Period Id","active":false},{"name":"name","label":"Name","type":"text","hint":"This field show Name","active":true},{"name":"description","label":"Description","type":"text","hint":"This field show Description","active":true},{"name":"max_score","label":"Max Score","type":"number","hint":"This field show Max Score","active":true},{"name":"weight_percentage","label":"Weight Percentage","type":"number","hint":"This field show Weight Percentage","active":false},{"name":"due_date","label":"Due Date","type":"date","hint":"This field show Due Date","active":true},{"name":"status","label":"Status","type":"text","hint":"This field show Status","active":true},{"name":"created_at","label":"Created At","type":"date","hint":"This field show Created At","active":false},{"name":"updated_at","label":"Updated At","type":"date","hint":"This field show Updated At","active":false},{"name":"subject_id__id","label":"Subject Id Id","type":"text","hint":"This field show [Subject Id Id]","active":false,"PK":true},{"name":"subject_id__code","label":"Subject Id Code","type":"text","hint":"This field show [Subject Id Code]","active":false},{"name":"subject_id__name","label":"Subject Id Name","type":"text","hint":"This field show [Subject Id Name]","active":true},{"name":"subject_id__description","label":"Subject Id Description","type":"text","hint":"This field show [Subject Id Description]","active":false},{"name":"subject_id__max_score","label":"Subject Id Max Score","type":"number","hint":"This field show [Subject Id Max Score]","active":false},{"name":"subject_id__status","label":"Subject Id Status","type":"text","hint":"This field show [Subject Id Status]","active":false},{"name":"subject_id__created_at","label":"Subject Id Created At","type":"date","hint":"This field show [Subject Id Created At]","active":false},{"name":"subject_id__updated_at","label":"Subject Id Updated At","type":"date","hint":"This field show [Subject Id Updated At]","active":false},{"name":"period_id__id","label":"Period Id Id","type":"text","hint":"This field show [Period Id Id]","active":false,"PK":true},{"name":"period_id__school_year_id","label":"Period Id School Year Id","type":"text","hint":"This field show [Period Id School Year Id]","active":false},{"name":"period_id__name","label":"Period Id Name","type":"text","hint":"This field show [Period Id Name]","active":true},{"name":"period_id__code","label":"Period Id Code","type":"text","hint":"This field show [Period Id Code]","active":false},{"name":"period_id__number","label":"Period Id Number","type":"number","hint":"This field show [Period Id Number]","active":false},{"name":"period_id__start_date","label":"Period Id Start Date","type":"date","hint":"This field show [Period Id Start Date]","active":false},{"name":"period_id__end_date","label":"Period Id End Date","type":"date","hint":"This field show [Period Id End Date]","active":false},{"name":"period_id__weight_percentage","label":"Period Id Weight Percentage","type":"number","hint":"This field show [Period Id Weight Percentage]","active":false},{"name":"period_id__status","label":"Period Id Status","type":"text","hint":"This field show [Period Id Status]","active":false},{"name":"period_id__created_at","label":"Period Id Created At","type":"date","hint":"This field show [Period Id Created At]","active":false},{"name":"period_id__updated_at","label":"Period Id Updated At","type":"date","hint":"This field show [Period Id Updated At]","active":false}], posible_fields: {"name":null,"description":null,"max_score":null,"due_date":null,"status":null,"subject_id__name":null,"period_id__name":null}, local_filter:{}, search:null, remove:null, pin:this.$pin(6), pin_verify:null, helpers:{ loading:false, page:1 }, inner_filter:{ search:null, limit:30, page:1 }, _skipWatch: false, timer:null }; }, props: { allow: { type: Array, default: () => [] }, attrs: { type: Object, default: () => {} }, inline:{ type: Boolean, default: false }, admin:{ type: Boolean, default: true }, binds: { type: Object, default: () => {} }, received_values: { type: Object, default: () => {} }, filter: { type: Object, default: () => {} }, ID: { type: String, required:false }, }, watch:{ binds: { handler(newValue, oldValue) { this.local_filter = { ...this.binds, ...this.received_values } }, immediate: false, // Ejecutar inmediatamente deep: true // Usar true si es un objeto/array }, received_values: { handler(newValue, oldValue) { this.local_filter = { ...this.binds, ...this.received_values } }, immediate: false, // Ejecutar inmediatamente deep: true // Usar true si es un objeto/array }, local_filter: { handler(newValue, oldValue) { if(this.helpers.loading==false){ this.Get() } }, immediate: false, // Ejecutar inmediatamente deep: true // Usar true si es un objeto/array }, ...['search', 'limit', 'sort', 'order', 'trashed', 'scope', 'date_from', 'date_to'].reduce((acc, field) => { acc[`inner_filter.${field}`] = function() { this.inner_filter.page = 1; }; return acc; }, {}), inner_filter: { inmediate:true, deep:true, handler(newId){ clearTimeout(this.timer) this.timer = setTimeout(()=>{ this.onSearch() },500) } } }, computed:{ render_header(){ let header = [] if (this.render.length>0) { this.render.forEach((field)=>{ if (field.active==='true' || field.active===true) { header.push({... { align:'start', key: field.name, sortable: true, title: field.label, } }); } }) } else { if(this.data && this.data.length>0){ header = Object.keys(this.data[0]).map(key => ({ align:'start', key: key, sortable: true, title: key.charAt(0).toUpperCase() + key.slice(1), })); } } header.push({... { align:'end', key: 'render_table_actions', sortable: false, title: '...', } }) return header }, pagination_length(){ if (!this.data) return 0; let total = this.data.count <= this.data.total ? this.data.total:this.data.count return Math.ceil(total/this.inner_filter.limit) } }, methods: { async Get(filter={}){ this.helpers.loading = true const promise = await this.$you.find('evaluations',filter) if(promise.status == 200){ this.data = promise?.data ?? [] } this.helpers.loading = false }, onSearch() { let search = new URLSearchParams(window.location.search) let filter = { ...search, ...this.binds, ...this.inner_filter} this.Get(filter) }, async Remove() { const promise = await axios.get('/api/evaluations/'+this.remove+'/remove'); if (promise.status==200) { this.remove = null this.pin = this.$pin(6) this.pin_verify = null this.Get() } }, async getPalette(img,item){ item['palette'] = await this.$colorPalette.getDominantColor(img) this.getContrastColor(item.palette,item) }, getContrastColor(color,item){ const contrastWithWhite = this.$colorPalette.getContrastRatio(color, '#FFFFFF') const contrastWithBlack = this.$colorPalette.getContrastRatio(color, '#000000') item['contrast'] = contrastWithWhite > contrastWithBlack ? '#FFFFFF' : '#000000' }, downloadFile(name,content){ const parts = content.split(',') if(parts.length !== 2){ alert('Invalid File') return } const typeBase64 = parts[0] const contentBase64 = parts[1] const typeMIME = typeBase64.split(';')[0].replace('data:','') const byteCharacters = atob(contentBase64) const byteNumbers = new Array(byteCharacters.length) for (let i = 0; i < byteCharacters.length; i++) { byteNumbers[i] = byteCharacters.charCodeAt(i) } const byteArray = new Uint8Array(byteNumbers) const blob = new Blob([byteArray],{type:typeMIME}) const link = document.createElement('a') link.href = URL.createObjectURL(blob) link.download = name document.body.appendChild(link) link.click() document.body.removeChild(link) }, }, mounted(){ this.onSearch() }, created(){ }, }; window.componentes.EvaluationsList = EvaluationsList; const GradesList = { template: `

ph-duotone ph-list-bullets Grados

mdi-format-text Name mdi-format-text Code Year Number mdi-format-text Description mdi-format-text Status mdi-dots-vertical-circle-outline mdi-dots-vertical-circle-outline
{{btn.icon || 'mdi-pointer'}} {{btn.title||'Custom Action'}}
{{btn.icon || 'mdi-pointer'}} {{btn.title||'Custom Action'}}
Details Update Delete
Show {{n*30}} Of {{data?.total ?? 0}} Eliminar Registro Ingrese el codigo: {{pin}} Eliminar Cerrar
`, data() { return { data:[], brick:{"id":"grades_list","owner":null,"table":"grades","name":"Grados","description":null,"method":"get","type":"all","fields":[{"name":"id","label":"Id","type":"text","hint":"This field show Id","active":false,"PK":true},{"name":"name","label":"Name","type":"text","hint":"This field show Name","active":true},{"name":"code","label":"Code","type":"text","hint":"This field show Code","active":true},{"name":"year_number","label":"Year Number","type":"number","hint":"This field show Year Number","active":true},{"name":"description","label":"Description","type":"text","hint":"This field show Description","active":true},{"name":"status","label":"Status","type":"text","hint":"This field show Status","active":true},{"name":"created_at","label":"Created At","type":"date","hint":"This field show Created At","active":false},{"name":"updated_at","label":"Updated At","type":"date","hint":"This field show Updated At","active":false}],"template":[],"custom_template":null,"custom_functions":null,"container":{"type":"table","append":"<\/div>;","prepend":"
","gutters":true,"items-per-page":30,"items-per-row":4},"delete":1,"filter":null,"options":null,"created_at":"2026-07-06 16:05:15"}, render: [{"name":"id","label":"Id","type":"text","hint":"This field show Id","active":false,"PK":true},{"name":"name","label":"Name","type":"text","hint":"This field show Name","active":true},{"name":"code","label":"Code","type":"text","hint":"This field show Code","active":true},{"name":"year_number","label":"Year Number","type":"number","hint":"This field show Year Number","active":true},{"name":"description","label":"Description","type":"text","hint":"This field show Description","active":true},{"name":"status","label":"Status","type":"text","hint":"This field show Status","active":true},{"name":"created_at","label":"Created At","type":"date","hint":"This field show Created At","active":false},{"name":"updated_at","label":"Updated At","type":"date","hint":"This field show Updated At","active":false}], posible_fields: {"name":null,"code":null,"year_number":null,"description":null,"status":null}, local_filter:{}, search:null, remove:null, pin:this.$pin(6), pin_verify:null, helpers:{ loading:false, page:1 }, inner_filter:{ search:null, limit:30, page:1 }, _skipWatch: false, timer:null }; }, props: { allow: { type: Array, default: () => [] }, attrs: { type: Object, default: () => {} }, inline:{ type: Boolean, default: false }, admin:{ type: Boolean, default: true }, binds: { type: Object, default: () => {} }, received_values: { type: Object, default: () => {} }, filter: { type: Object, default: () => {} }, ID: { type: String, required:false }, }, watch:{ binds: { handler(newValue, oldValue) { this.local_filter = { ...this.binds, ...this.received_values } }, immediate: false, // Ejecutar inmediatamente deep: true // Usar true si es un objeto/array }, received_values: { handler(newValue, oldValue) { this.local_filter = { ...this.binds, ...this.received_values } }, immediate: false, // Ejecutar inmediatamente deep: true // Usar true si es un objeto/array }, local_filter: { handler(newValue, oldValue) { if(this.helpers.loading==false){ this.Get() } }, immediate: false, // Ejecutar inmediatamente deep: true // Usar true si es un objeto/array }, ...['search', 'limit', 'sort', 'order', 'trashed', 'scope', 'date_from', 'date_to'].reduce((acc, field) => { acc[`inner_filter.${field}`] = function() { this.inner_filter.page = 1; }; return acc; }, {}), inner_filter: { inmediate:true, deep:true, handler(newId){ clearTimeout(this.timer) this.timer = setTimeout(()=>{ this.onSearch() },500) } } }, computed:{ render_header(){ let header = [] if (this.render.length>0) { this.render.forEach((field)=>{ if (field.active==='true' || field.active===true) { header.push({... { align:'start', key: field.name, sortable: true, title: field.label, } }); } }) } else { if(this.data && this.data.length>0){ header = Object.keys(this.data[0]).map(key => ({ align:'start', key: key, sortable: true, title: key.charAt(0).toUpperCase() + key.slice(1), })); } } header.push({... { align:'end', key: 'render_table_actions', sortable: false, title: '...', } }) return header }, pagination_length(){ if (!this.data) return 0; let total = this.data.count <= this.data.total ? this.data.total:this.data.count return Math.ceil(total/this.inner_filter.limit) } }, methods: { async Get(filter={}){ this.helpers.loading = true const promise = await this.$you.find('grades',filter) if(promise.status == 200){ this.data = promise?.data ?? [] } this.helpers.loading = false }, onSearch() { let search = new URLSearchParams(window.location.search) let filter = { ...search, ...this.binds, ...this.inner_filter} this.Get(filter) }, async Remove() { const promise = await axios.get('/api/grades/'+this.remove+'/remove'); if (promise.status==200) { this.remove = null this.pin = this.$pin(6) this.pin_verify = null this.Get() } }, async getPalette(img,item){ item['palette'] = await this.$colorPalette.getDominantColor(img) this.getContrastColor(item.palette,item) }, getContrastColor(color,item){ const contrastWithWhite = this.$colorPalette.getContrastRatio(color, '#FFFFFF') const contrastWithBlack = this.$colorPalette.getContrastRatio(color, '#000000') item['contrast'] = contrastWithWhite > contrastWithBlack ? '#FFFFFF' : '#000000' }, downloadFile(name,content){ const parts = content.split(',') if(parts.length !== 2){ alert('Invalid File') return } const typeBase64 = parts[0] const contentBase64 = parts[1] const typeMIME = typeBase64.split(';')[0].replace('data:','') const byteCharacters = atob(contentBase64) const byteNumbers = new Array(byteCharacters.length) for (let i = 0; i < byteCharacters.length; i++) { byteNumbers[i] = byteCharacters.charCodeAt(i) } const byteArray = new Uint8Array(byteNumbers) const blob = new Blob([byteArray],{type:typeMIME}) const link = document.createElement('a') link.href = URL.createObjectURL(blob) link.download = name document.body.appendChild(link) link.click() document.body.removeChild(link) }, }, mounted(){ this.onSearch() }, created(){ }, }; window.componentes.GradesList = GradesList; const PeriodsList = { template: `

ph-duotone ph-list-bullets Lapsos

mdi-format-text Name mdi-format-text Code Number Start Date End Date Weight Percentage mdi-format-text Status mdi-format-text School Year Id Name mdi-dots-vertical-circle-outline mdi-dots-vertical-circle-outline
{{btn.icon || 'mdi-pointer'}} {{btn.title||'Custom Action'}}
{{btn.icon || 'mdi-pointer'}} {{btn.title||'Custom Action'}}
Details Update Delete
Show {{n*30}} Of {{data?.total ?? 0}} Eliminar Registro Ingrese el codigo: {{pin}} Eliminar Cerrar
`, data() { return { data:[], brick:{"id":"periods_list","owner":null,"table":"periods","name":"Lapsos","description":null,"method":"get","type":"all","fields":[{"name":"id","label":"Id","type":"text","hint":"This field show Id","active":false,"PK":true},{"name":"school_year_id","label":"School Year Id","type":"relation","hint":"This field show School Year Id","active":false},{"name":"name","label":"Name","type":"text","hint":"This field show Name","active":true},{"name":"code","label":"Code","type":"text","hint":"This field show Code","active":true},{"name":"number","label":"Number","type":"number","hint":"This field show Number","active":true},{"name":"start_date","label":"Start Date","type":"date","hint":"This field show Start Date","active":true},{"name":"end_date","label":"End Date","type":"date","hint":"This field show End Date","active":true},{"name":"weight_percentage","label":"Weight Percentage","type":"number","hint":"This field show Weight Percentage","active":true},{"name":"status","label":"Status","type":"text","hint":"This field show Status","active":true},{"name":"created_at","label":"Created At","type":"date","hint":"This field show Created At","active":false},{"name":"updated_at","label":"Updated At","type":"date","hint":"This field show Updated At","active":false},{"name":"school_year_id__id","label":"School Year Id Id","type":"text","hint":"This field show [School Year Id Id]","active":false,"PK":true},{"name":"school_year_id__name","label":"School Year Id Name","type":"text","hint":"This field show [School Year Id Name]","active":true},{"name":"school_year_id__code","label":"School Year Id Code","type":"text","hint":"This field show [School Year Id Code]","active":false},{"name":"school_year_id__start_date","label":"School Year Id Start Date","type":"date","hint":"This field show [School Year Id Start Date]","active":false},{"name":"school_year_id__end_date","label":"School Year Id End Date","type":"date","hint":"This field show [School Year Id End Date]","active":false},{"name":"school_year_id__is_current","label":"School Year Id Is Current","type":"number","hint":"This field show [School Year Id Is Current]","active":false},{"name":"school_year_id__status","label":"School Year Id Status","type":"text","hint":"This field show [School Year Id Status]","active":false},{"name":"school_year_id__created_at","label":"School Year Id Created At","type":"date","hint":"This field show [School Year Id Created At]","active":false},{"name":"school_year_id__updated_at","label":"School Year Id Updated At","type":"date","hint":"This field show [School Year Id Updated At]","active":false}],"template":[],"custom_template":null,"custom_functions":null,"container":{"type":"table","append":"<\/div>;","prepend":"
","gutters":true,"items-per-page":30,"items-per-row":4},"delete":1,"filter":null,"options":null,"created_at":"2026-07-06 16:11:23"}, render: [{"name":"id","label":"Id","type":"text","hint":"This field show Id","active":false,"PK":true},{"name":"school_year_id","label":"School Year Id","type":"relation","hint":"This field show School Year Id","active":false},{"name":"name","label":"Name","type":"text","hint":"This field show Name","active":true},{"name":"code","label":"Code","type":"text","hint":"This field show Code","active":true},{"name":"number","label":"Number","type":"number","hint":"This field show Number","active":true},{"name":"start_date","label":"Start Date","type":"date","hint":"This field show Start Date","active":true},{"name":"end_date","label":"End Date","type":"date","hint":"This field show End Date","active":true},{"name":"weight_percentage","label":"Weight Percentage","type":"number","hint":"This field show Weight Percentage","active":true},{"name":"status","label":"Status","type":"text","hint":"This field show Status","active":true},{"name":"created_at","label":"Created At","type":"date","hint":"This field show Created At","active":false},{"name":"updated_at","label":"Updated At","type":"date","hint":"This field show Updated At","active":false},{"name":"school_year_id__id","label":"School Year Id Id","type":"text","hint":"This field show [School Year Id Id]","active":false,"PK":true},{"name":"school_year_id__name","label":"School Year Id Name","type":"text","hint":"This field show [School Year Id Name]","active":true},{"name":"school_year_id__code","label":"School Year Id Code","type":"text","hint":"This field show [School Year Id Code]","active":false},{"name":"school_year_id__start_date","label":"School Year Id Start Date","type":"date","hint":"This field show [School Year Id Start Date]","active":false},{"name":"school_year_id__end_date","label":"School Year Id End Date","type":"date","hint":"This field show [School Year Id End Date]","active":false},{"name":"school_year_id__is_current","label":"School Year Id Is Current","type":"number","hint":"This field show [School Year Id Is Current]","active":false},{"name":"school_year_id__status","label":"School Year Id Status","type":"text","hint":"This field show [School Year Id Status]","active":false},{"name":"school_year_id__created_at","label":"School Year Id Created At","type":"date","hint":"This field show [School Year Id Created At]","active":false},{"name":"school_year_id__updated_at","label":"School Year Id Updated At","type":"date","hint":"This field show [School Year Id Updated At]","active":false}], posible_fields: {"name":null,"code":null,"number":null,"start_date":null,"end_date":null,"weight_percentage":null,"status":null,"school_year_id__name":null}, local_filter:{}, search:null, remove:null, pin:this.$pin(6), pin_verify:null, helpers:{ loading:false, page:1 }, inner_filter:{ search:null, limit:30, page:1 }, _skipWatch: false, timer:null }; }, props: { allow: { type: Array, default: () => [] }, attrs: { type: Object, default: () => {} }, inline:{ type: Boolean, default: false }, admin:{ type: Boolean, default: true }, binds: { type: Object, default: () => {} }, received_values: { type: Object, default: () => {} }, filter: { type: Object, default: () => {} }, ID: { type: String, required:false }, }, watch:{ binds: { handler(newValue, oldValue) { this.local_filter = { ...this.binds, ...this.received_values } }, immediate: false, // Ejecutar inmediatamente deep: true // Usar true si es un objeto/array }, received_values: { handler(newValue, oldValue) { this.local_filter = { ...this.binds, ...this.received_values } }, immediate: false, // Ejecutar inmediatamente deep: true // Usar true si es un objeto/array }, local_filter: { handler(newValue, oldValue) { if(this.helpers.loading==false){ this.Get() } }, immediate: false, // Ejecutar inmediatamente deep: true // Usar true si es un objeto/array }, ...['search', 'limit', 'sort', 'order', 'trashed', 'scope', 'date_from', 'date_to'].reduce((acc, field) => { acc[`inner_filter.${field}`] = function() { this.inner_filter.page = 1; }; return acc; }, {}), inner_filter: { inmediate:true, deep:true, handler(newId){ clearTimeout(this.timer) this.timer = setTimeout(()=>{ this.onSearch() },500) } } }, computed:{ render_header(){ let header = [] if (this.render.length>0) { this.render.forEach((field)=>{ if (field.active==='true' || field.active===true) { header.push({... { align:'start', key: field.name, sortable: true, title: field.label, } }); } }) } else { if(this.data && this.data.length>0){ header = Object.keys(this.data[0]).map(key => ({ align:'start', key: key, sortable: true, title: key.charAt(0).toUpperCase() + key.slice(1), })); } } header.push({... { align:'end', key: 'render_table_actions', sortable: false, title: '...', } }) return header }, pagination_length(){ if (!this.data) return 0; let total = this.data.count <= this.data.total ? this.data.total:this.data.count return Math.ceil(total/this.inner_filter.limit) } }, methods: { async Get(filter={}){ this.helpers.loading = true const promise = await this.$you.find('periods',filter) if(promise.status == 200){ this.data = promise?.data ?? [] } this.helpers.loading = false }, onSearch() { let search = new URLSearchParams(window.location.search) let filter = { ...search, ...this.binds, ...this.inner_filter} this.Get(filter) }, async Remove() { const promise = await axios.get('/api/periods/'+this.remove+'/remove'); if (promise.status==200) { this.remove = null this.pin = this.$pin(6) this.pin_verify = null this.Get() } }, async getPalette(img,item){ item['palette'] = await this.$colorPalette.getDominantColor(img) this.getContrastColor(item.palette,item) }, getContrastColor(color,item){ const contrastWithWhite = this.$colorPalette.getContrastRatio(color, '#FFFFFF') const contrastWithBlack = this.$colorPalette.getContrastRatio(color, '#000000') item['contrast'] = contrastWithWhite > contrastWithBlack ? '#FFFFFF' : '#000000' }, downloadFile(name,content){ const parts = content.split(',') if(parts.length !== 2){ alert('Invalid File') return } const typeBase64 = parts[0] const contentBase64 = parts[1] const typeMIME = typeBase64.split(';')[0].replace('data:','') const byteCharacters = atob(contentBase64) const byteNumbers = new Array(byteCharacters.length) for (let i = 0; i < byteCharacters.length; i++) { byteNumbers[i] = byteCharacters.charCodeAt(i) } const byteArray = new Uint8Array(byteNumbers) const blob = new Blob([byteArray],{type:typeMIME}) const link = document.createElement('a') link.href = URL.createObjectURL(blob) link.download = name document.body.appendChild(link) link.click() document.body.removeChild(link) }, }, mounted(){ this.onSearch() }, created(){ }, }; window.componentes.PeriodsList = PeriodsList; const SchoolYearsGetAllTXgmMfiY = { template: `

ph-duotone ph-list-bullets Periodo Escolar

mdi-format-text Name mdi-format-text Code Start Date End Date mdi-dots-vertical-circle-outline mdi-dots-vertical-circle-outline
{{btn.icon || 'mdi-pointer'}} {{btn.title||'Custom Action'}}
{{btn.icon || 'mdi-pointer'}} {{btn.title||'Custom Action'}}
Details Update Delete
Show {{n*30}} Of {{data?.total ?? 0}} Eliminar Registro Ingrese el codigo: {{pin}} Eliminar Cerrar
`, data() { return { data:[], brick:{"id":"school_years_get_all_tXgmMfiY","owner":null,"table":"school_years","name":"Periodo Escolar","description":null,"method":"get","type":"all","fields":[{"name":"id","label":"Id","type":"text","hint":"This field show [Id]","active":false,"PK":true},{"name":"name","label":"Name","type":"text","hint":"This field show [Name]","active":true},{"name":"code","label":"Code","type":"text","hint":"This field show [Code]","active":true},{"name":"start_date","label":"Start Date","type":"date","hint":"This field show [Start Date]","active":true},{"name":"end_date","label":"End Date","type":"date","hint":"This field show [End Date]","active":true},{"name":"is_current","label":"Is Current","type":"number","hint":"This field show [Is Current]","active":false},{"name":"status","label":"Status","type":"text","hint":"This field show [Status]","active":false},{"name":"created_at","label":"Created At","type":"date","hint":"This field show [Created At]","active":false},{"name":"updated_at","label":"Updated At","type":"date","hint":"This field show [Updated At]","active":false}],"template":[],"custom_template":null,"custom_functions":null,"container":{"type":"table","append":"<\/div>","prepend":"
","gutters":true,"items-per-page":30,"items-per-row":4},"delete":1,"filter":null,"options":null,"created_at":"2026-07-15 15:38:16"}, render: [{"name":"id","label":"Id","type":"text","hint":"This field show [Id]","active":false,"PK":true},{"name":"name","label":"Name","type":"text","hint":"This field show [Name]","active":true},{"name":"code","label":"Code","type":"text","hint":"This field show [Code]","active":true},{"name":"start_date","label":"Start Date","type":"date","hint":"This field show [Start Date]","active":true},{"name":"end_date","label":"End Date","type":"date","hint":"This field show [End Date]","active":true},{"name":"is_current","label":"Is Current","type":"number","hint":"This field show [Is Current]","active":false},{"name":"status","label":"Status","type":"text","hint":"This field show [Status]","active":false},{"name":"created_at","label":"Created At","type":"date","hint":"This field show [Created At]","active":false},{"name":"updated_at","label":"Updated At","type":"date","hint":"This field show [Updated At]","active":false}], posible_fields: {"name":null,"code":null,"start_date":null,"end_date":null}, local_filter:{}, search:null, remove:null, pin:this.$pin(6), pin_verify:null, helpers:{ loading:false, page:1 }, inner_filter:{ search:null, limit:30, page:1 }, _skipWatch: false, timer:null }; }, props: { allow: { type: Array, default: () => [] }, attrs: { type: Object, default: () => {} }, inline:{ type: Boolean, default: false }, admin:{ type: Boolean, default: true }, binds: { type: Object, default: () => {} }, received_values: { type: Object, default: () => {} }, filter: { type: Object, default: () => {} }, ID: { type: String, required:false }, }, watch:{ binds: { handler(newValue, oldValue) { this.local_filter = { ...this.binds, ...this.received_values } }, immediate: false, // Ejecutar inmediatamente deep: true // Usar true si es un objeto/array }, received_values: { handler(newValue, oldValue) { this.local_filter = { ...this.binds, ...this.received_values } }, immediate: false, // Ejecutar inmediatamente deep: true // Usar true si es un objeto/array }, local_filter: { handler(newValue, oldValue) { if(this.helpers.loading==false){ this.Get() } }, immediate: false, // Ejecutar inmediatamente deep: true // Usar true si es un objeto/array }, ...['search', 'limit', 'sort', 'order', 'trashed', 'scope', 'date_from', 'date_to'].reduce((acc, field) => { acc[`inner_filter.${field}`] = function() { this.inner_filter.page = 1; }; return acc; }, {}), inner_filter: { inmediate:true, deep:true, handler(newId){ clearTimeout(this.timer) this.timer = setTimeout(()=>{ this.onSearch() },500) } } }, computed:{ render_header(){ let header = [] if (this.render.length>0) { this.render.forEach((field)=>{ if (field.active==='true' || field.active===true) { header.push({... { align:'start', key: field.name, sortable: true, title: field.label, } }); } }) } else { if(this.data && this.data.length>0){ header = Object.keys(this.data[0]).map(key => ({ align:'start', key: key, sortable: true, title: key.charAt(0).toUpperCase() + key.slice(1), })); } } header.push({... { align:'end', key: 'render_table_actions', sortable: false, title: '...', } }) return header }, pagination_length(){ if (!this.data) return 0; let total = this.data.count <= this.data.total ? this.data.total:this.data.count return Math.ceil(total/this.inner_filter.limit) } }, methods: { async Get(filter={}){ this.helpers.loading = true const promise = await this.$you.find('school_years',filter) if(promise.status == 200){ this.data = promise?.data ?? [] } this.helpers.loading = false }, onSearch() { let search = new URLSearchParams(window.location.search) let filter = { ...search, ...this.binds, ...this.inner_filter} this.Get(filter) }, async Remove() { const promise = await axios.get('/api/school_years/'+this.remove+'/remove'); if (promise.status==200) { this.remove = null this.pin = this.$pin(6) this.pin_verify = null this.Get() } }, async getPalette(img,item){ item['palette'] = await this.$colorPalette.getDominantColor(img) this.getContrastColor(item.palette,item) }, getContrastColor(color,item){ const contrastWithWhite = this.$colorPalette.getContrastRatio(color, '#FFFFFF') const contrastWithBlack = this.$colorPalette.getContrastRatio(color, '#000000') item['contrast'] = contrastWithWhite > contrastWithBlack ? '#FFFFFF' : '#000000' }, downloadFile(name,content){ const parts = content.split(',') if(parts.length !== 2){ alert('Invalid File') return } const typeBase64 = parts[0] const contentBase64 = parts[1] const typeMIME = typeBase64.split(';')[0].replace('data:','') const byteCharacters = atob(contentBase64) const byteNumbers = new Array(byteCharacters.length) for (let i = 0; i < byteCharacters.length; i++) { byteNumbers[i] = byteCharacters.charCodeAt(i) } const byteArray = new Uint8Array(byteNumbers) const blob = new Blob([byteArray],{type:typeMIME}) const link = document.createElement('a') link.href = URL.createObjectURL(blob) link.download = name document.body.appendChild(link) link.click() document.body.removeChild(link) }, }, mounted(){ this.onSearch() }, created(){ }, }; window.componentes.SchoolYearsGetAllTXgmMfiY = SchoolYearsGetAllTXgmMfiY; const SectionsList = { template: `

ph-duotone ph-list-bullets Secciones

mdi-format-text Name mdi-format-text Code Capacity mdi-format-text Status mdi-dots-vertical-circle-outline mdi-dots-vertical-circle-outline
{{btn.icon || 'mdi-pointer'}} {{btn.title||'Custom Action'}}
{{btn.icon || 'mdi-pointer'}} {{btn.title||'Custom Action'}}
Details Update Delete
Show {{n*30}} Of {{data?.total ?? 0}} Eliminar Registro Ingrese el codigo: {{pin}} Eliminar Cerrar
`, data() { return { data:[], brick:{"id":"sections_list","owner":null,"table":"sections","name":"Secciones","description":null,"method":"get","type":"all","fields":[{"name":"id","label":"Id","type":"text","hint":"This field show Id","active":false,"PK":true},{"name":"name","label":"Name","type":"text","hint":"This field show Name","active":true},{"name":"code","label":"Code","type":"text","hint":"This field show Code","active":true},{"name":"capacity","label":"Capacity","type":"number","hint":"This field show Capacity","active":true},{"name":"status","label":"Status","type":"text","hint":"This field show Status","active":true},{"name":"created_at","label":"Created At","type":"date","hint":"This field show Created At","active":false},{"name":"updated_at","label":"Updated At","type":"date","hint":"This field show Updated At","active":false}],"template":[],"custom_template":null,"custom_functions":null,"container":{"type":"table","append":"<\/div>;","prepend":"
","gutters":true,"items-per-page":30,"items-per-row":4},"delete":1,"filter":null,"options":null,"created_at":"2026-07-06 16:07:47"}, render: [{"name":"id","label":"Id","type":"text","hint":"This field show Id","active":false,"PK":true},{"name":"name","label":"Name","type":"text","hint":"This field show Name","active":true},{"name":"code","label":"Code","type":"text","hint":"This field show Code","active":true},{"name":"capacity","label":"Capacity","type":"number","hint":"This field show Capacity","active":true},{"name":"status","label":"Status","type":"text","hint":"This field show Status","active":true},{"name":"created_at","label":"Created At","type":"date","hint":"This field show Created At","active":false},{"name":"updated_at","label":"Updated At","type":"date","hint":"This field show Updated At","active":false}], posible_fields: {"name":null,"code":null,"capacity":null,"status":null}, local_filter:{}, search:null, remove:null, pin:this.$pin(6), pin_verify:null, helpers:{ loading:false, page:1 }, inner_filter:{ search:null, limit:30, page:1 }, _skipWatch: false, timer:null }; }, props: { allow: { type: Array, default: () => [] }, attrs: { type: Object, default: () => {} }, inline:{ type: Boolean, default: false }, admin:{ type: Boolean, default: true }, binds: { type: Object, default: () => {} }, received_values: { type: Object, default: () => {} }, filter: { type: Object, default: () => {} }, ID: { type: String, required:false }, }, watch:{ binds: { handler(newValue, oldValue) { this.local_filter = { ...this.binds, ...this.received_values } }, immediate: false, // Ejecutar inmediatamente deep: true // Usar true si es un objeto/array }, received_values: { handler(newValue, oldValue) { this.local_filter = { ...this.binds, ...this.received_values } }, immediate: false, // Ejecutar inmediatamente deep: true // Usar true si es un objeto/array }, local_filter: { handler(newValue, oldValue) { if(this.helpers.loading==false){ this.Get() } }, immediate: false, // Ejecutar inmediatamente deep: true // Usar true si es un objeto/array }, ...['search', 'limit', 'sort', 'order', 'trashed', 'scope', 'date_from', 'date_to'].reduce((acc, field) => { acc[`inner_filter.${field}`] = function() { this.inner_filter.page = 1; }; return acc; }, {}), inner_filter: { inmediate:true, deep:true, handler(newId){ clearTimeout(this.timer) this.timer = setTimeout(()=>{ this.onSearch() },500) } } }, computed:{ render_header(){ let header = [] if (this.render.length>0) { this.render.forEach((field)=>{ if (field.active==='true' || field.active===true) { header.push({... { align:'start', key: field.name, sortable: true, title: field.label, } }); } }) } else { if(this.data && this.data.length>0){ header = Object.keys(this.data[0]).map(key => ({ align:'start', key: key, sortable: true, title: key.charAt(0).toUpperCase() + key.slice(1), })); } } header.push({... { align:'end', key: 'render_table_actions', sortable: false, title: '...', } }) return header }, pagination_length(){ if (!this.data) return 0; let total = this.data.count <= this.data.total ? this.data.total:this.data.count return Math.ceil(total/this.inner_filter.limit) } }, methods: { async Get(filter={}){ this.helpers.loading = true const promise = await this.$you.find('sections',filter) if(promise.status == 200){ this.data = promise?.data ?? [] } this.helpers.loading = false }, onSearch() { let search = new URLSearchParams(window.location.search) let filter = { ...search, ...this.binds, ...this.inner_filter} this.Get(filter) }, async Remove() { const promise = await axios.get('/api/sections/'+this.remove+'/remove'); if (promise.status==200) { this.remove = null this.pin = this.$pin(6) this.pin_verify = null this.Get() } }, async getPalette(img,item){ item['palette'] = await this.$colorPalette.getDominantColor(img) this.getContrastColor(item.palette,item) }, getContrastColor(color,item){ const contrastWithWhite = this.$colorPalette.getContrastRatio(color, '#FFFFFF') const contrastWithBlack = this.$colorPalette.getContrastRatio(color, '#000000') item['contrast'] = contrastWithWhite > contrastWithBlack ? '#FFFFFF' : '#000000' }, downloadFile(name,content){ const parts = content.split(',') if(parts.length !== 2){ alert('Invalid File') return } const typeBase64 = parts[0] const contentBase64 = parts[1] const typeMIME = typeBase64.split(';')[0].replace('data:','') const byteCharacters = atob(contentBase64) const byteNumbers = new Array(byteCharacters.length) for (let i = 0; i < byteCharacters.length; i++) { byteNumbers[i] = byteCharacters.charCodeAt(i) } const byteArray = new Uint8Array(byteNumbers) const blob = new Blob([byteArray],{type:typeMIME}) const link = document.createElement('a') link.href = URL.createObjectURL(blob) link.download = name document.body.appendChild(link) link.click() document.body.removeChild(link) }, }, mounted(){ this.onSearch() }, created(){ }, }; window.componentes.SectionsList = SectionsList; const StudentsList = { template: `

ph-duotone ph-list-bullets Lista de estudiantes

mdi-format-text Dni mdi-format-text Fullname mdi-format-text Gender mdi-format-text Grade Id Name mdi-format-text School Year Id Name mdi-format-text Section Id Name mdi-dots-vertical-circle-outline mdi-dots-vertical-circle-outline
{{btn.icon || 'mdi-pointer'}} {{btn.title||'Custom Action'}}
{{btn.icon || 'mdi-pointer'}} {{btn.title||'Custom Action'}}
Details Update Delete
Show {{n*30}} Of {{data?.total ?? 0}} Eliminar Registro Ingrese el codigo: {{pin}} Eliminar Cerrar
`, data() { return { data:[], brick:{"id":"students_list","owner":null,"table":"students","name":"Lista de estudiantes","description":null,"method":"get","type":"all","fields":[{"name":"id","label":"Id","type":"text","hint":"This field show [Id]","active":false,"PK":true},{"name":"student_code","label":"Student Code","type":"text","hint":"This field show [Student Code]","active":false},{"name":"dni","label":"Dni","type":"text","hint":"This field show [Dni]","active":true},{"name":"fullname","label":"Fullname","type":"text","hint":"This field show [Fullname]","active":true},{"name":"date_of_birth","label":"Date Of Birth","type":"date","hint":"This field show [Date Of Birth]","active":false},{"name":"gender","label":"Gender","type":"text","hint":"This field show [Gender]","active":true},{"name":"phone","label":"Phone","type":"text","hint":"This field show [Phone]","active":false},{"name":"email","label":"Email","type":"text","hint":"This field show [Email]","active":false},{"name":"address","label":"Address","type":"text","hint":"This field show [Address]","active":false},{"name":"school_year_id","label":"School Year Id","type":"relation","hint":"This field show [School Year Id]","active":false},{"name":"grade_id","label":"Grade Id","type":"relation","hint":"This field show [Grade Id]","active":false},{"name":"section_id","label":"Section Id","type":"relation","hint":"This field show [Section Id]","active":false},{"name":"enrollment_status","label":"Enrollment Status","type":"text","hint":"This field show [Enrollment Status]","active":false},{"name":"created_at","label":"Created At","type":"date","hint":"This field show [Created At]","active":false},{"name":"updated_at","label":"Updated At","type":"date","hint":"This field show [Updated At]","active":false},{"name":"grade_id__id","label":"Grade Id Id","type":"text","hint":"This field show [Grade Id Id]","active":false,"PK":true},{"name":"grade_id__name","label":"Grade Id Name","type":"text","hint":"This field show [Grade Id Name]","active":true},{"name":"grade_id__code","label":"Grade Id Code","type":"text","hint":"This field show [Grade Id Code]","active":false},{"name":"grade_id__year_number","label":"Grade Id Year Number","type":"number","hint":"This field show [Grade Id Year Number]","active":false},{"name":"grade_id__description","label":"Grade Id Description","type":"text","hint":"This field show [Grade Id Description]","active":false},{"name":"grade_id__status","label":"Grade Id Status","type":"text","hint":"This field show [Grade Id Status]","active":false},{"name":"grade_id__created_at","label":"Grade Id Created At","type":"date","hint":"This field show [Grade Id Created At]","active":false},{"name":"grade_id__updated_at","label":"Grade Id Updated At","type":"date","hint":"This field show [Grade Id Updated At]","active":false},{"name":"school_year_id__id","label":"School Year Id Id","type":"text","hint":"This field show [School Year Id Id]","active":false,"PK":true},{"name":"school_year_id__name","label":"School Year Id Name","type":"text","hint":"This field show [School Year Id Name]","active":true},{"name":"school_year_id__code","label":"School Year Id Code","type":"text","hint":"This field show [School Year Id Code]","active":false},{"name":"school_year_id__start_date","label":"School Year Id Start Date","type":"date","hint":"This field show [School Year Id Start Date]","active":false},{"name":"school_year_id__end_date","label":"School Year Id End Date","type":"date","hint":"This field show [School Year Id End Date]","active":false},{"name":"school_year_id__is_current","label":"School Year Id Is Current","type":"number","hint":"This field show [School Year Id Is Current]","active":false},{"name":"school_year_id__status","label":"School Year Id Status","type":"text","hint":"This field show [School Year Id Status]","active":false},{"name":"school_year_id__created_at","label":"School Year Id Created At","type":"date","hint":"This field show [School Year Id Created At]","active":false},{"name":"school_year_id__updated_at","label":"School Year Id Updated At","type":"date","hint":"This field show [School Year Id Updated At]","active":false},{"name":"section_id__id","label":"Section Id Id","type":"text","hint":"This field show [Section Id Id]","active":false,"PK":true},{"name":"section_id__name","label":"Section Id Name","type":"text","hint":"This field show [Section Id Name]","active":true},{"name":"section_id__code","label":"Section Id Code","type":"text","hint":"This field show [Section Id Code]","active":false},{"name":"section_id__capacity","label":"Section Id Capacity","type":"number","hint":"This field show [Section Id Capacity]","active":false},{"name":"section_id__status","label":"Section Id Status","type":"text","hint":"This field show [Section Id Status]","active":false},{"name":"section_id__created_at","label":"Section Id Created At","type":"date","hint":"This field show [Section Id Created At]","active":false},{"name":"section_id__updated_at","label":"Section Id Updated At","type":"date","hint":"This field show [Section Id Updated At]","active":false}],"template":[],"custom_template":null,"custom_functions":null,"container":{"type":"table","append":"<\/div>;","prepend":"
","gutters":true,"items-per-page":30,"items-per-row":4},"delete":1,"filter":null,"options":null,"created_at":"2026-07-07 18:18:26"}, render: [{"name":"id","label":"Id","type":"text","hint":"This field show [Id]","active":false,"PK":true},{"name":"student_code","label":"Student Code","type":"text","hint":"This field show [Student Code]","active":false},{"name":"dni","label":"Dni","type":"text","hint":"This field show [Dni]","active":true},{"name":"fullname","label":"Fullname","type":"text","hint":"This field show [Fullname]","active":true},{"name":"date_of_birth","label":"Date Of Birth","type":"date","hint":"This field show [Date Of Birth]","active":false},{"name":"gender","label":"Gender","type":"text","hint":"This field show [Gender]","active":true},{"name":"phone","label":"Phone","type":"text","hint":"This field show [Phone]","active":false},{"name":"email","label":"Email","type":"text","hint":"This field show [Email]","active":false},{"name":"address","label":"Address","type":"text","hint":"This field show [Address]","active":false},{"name":"school_year_id","label":"School Year Id","type":"relation","hint":"This field show [School Year Id]","active":false},{"name":"grade_id","label":"Grade Id","type":"relation","hint":"This field show [Grade Id]","active":false},{"name":"section_id","label":"Section Id","type":"relation","hint":"This field show [Section Id]","active":false},{"name":"enrollment_status","label":"Enrollment Status","type":"text","hint":"This field show [Enrollment Status]","active":false},{"name":"created_at","label":"Created At","type":"date","hint":"This field show [Created At]","active":false},{"name":"updated_at","label":"Updated At","type":"date","hint":"This field show [Updated At]","active":false},{"name":"grade_id__id","label":"Grade Id Id","type":"text","hint":"This field show [Grade Id Id]","active":false,"PK":true},{"name":"grade_id__name","label":"Grade Id Name","type":"text","hint":"This field show [Grade Id Name]","active":true},{"name":"grade_id__code","label":"Grade Id Code","type":"text","hint":"This field show [Grade Id Code]","active":false},{"name":"grade_id__year_number","label":"Grade Id Year Number","type":"number","hint":"This field show [Grade Id Year Number]","active":false},{"name":"grade_id__description","label":"Grade Id Description","type":"text","hint":"This field show [Grade Id Description]","active":false},{"name":"grade_id__status","label":"Grade Id Status","type":"text","hint":"This field show [Grade Id Status]","active":false},{"name":"grade_id__created_at","label":"Grade Id Created At","type":"date","hint":"This field show [Grade Id Created At]","active":false},{"name":"grade_id__updated_at","label":"Grade Id Updated At","type":"date","hint":"This field show [Grade Id Updated At]","active":false},{"name":"school_year_id__id","label":"School Year Id Id","type":"text","hint":"This field show [School Year Id Id]","active":false,"PK":true},{"name":"school_year_id__name","label":"School Year Id Name","type":"text","hint":"This field show [School Year Id Name]","active":true},{"name":"school_year_id__code","label":"School Year Id Code","type":"text","hint":"This field show [School Year Id Code]","active":false},{"name":"school_year_id__start_date","label":"School Year Id Start Date","type":"date","hint":"This field show [School Year Id Start Date]","active":false},{"name":"school_year_id__end_date","label":"School Year Id End Date","type":"date","hint":"This field show [School Year Id End Date]","active":false},{"name":"school_year_id__is_current","label":"School Year Id Is Current","type":"number","hint":"This field show [School Year Id Is Current]","active":false},{"name":"school_year_id__status","label":"School Year Id Status","type":"text","hint":"This field show [School Year Id Status]","active":false},{"name":"school_year_id__created_at","label":"School Year Id Created At","type":"date","hint":"This field show [School Year Id Created At]","active":false},{"name":"school_year_id__updated_at","label":"School Year Id Updated At","type":"date","hint":"This field show [School Year Id Updated At]","active":false},{"name":"section_id__id","label":"Section Id Id","type":"text","hint":"This field show [Section Id Id]","active":false,"PK":true},{"name":"section_id__name","label":"Section Id Name","type":"text","hint":"This field show [Section Id Name]","active":true},{"name":"section_id__code","label":"Section Id Code","type":"text","hint":"This field show [Section Id Code]","active":false},{"name":"section_id__capacity","label":"Section Id Capacity","type":"number","hint":"This field show [Section Id Capacity]","active":false},{"name":"section_id__status","label":"Section Id Status","type":"text","hint":"This field show [Section Id Status]","active":false},{"name":"section_id__created_at","label":"Section Id Created At","type":"date","hint":"This field show [Section Id Created At]","active":false},{"name":"section_id__updated_at","label":"Section Id Updated At","type":"date","hint":"This field show [Section Id Updated At]","active":false}], posible_fields: {"dni":null,"fullname":null,"gender":null,"grade_id__name":null,"school_year_id__name":null,"section_id__name":null}, local_filter:{}, search:null, remove:null, pin:this.$pin(6), pin_verify:null, helpers:{ loading:false, page:1 }, inner_filter:{ search:null, limit:30, page:1 }, _skipWatch: false, timer:null }; }, props: { allow: { type: Array, default: () => [] }, attrs: { type: Object, default: () => {} }, inline:{ type: Boolean, default: false }, admin:{ type: Boolean, default: true }, binds: { type: Object, default: () => {} }, received_values: { type: Object, default: () => {} }, filter: { type: Object, default: () => {} }, ID: { type: String, required:false }, }, watch:{ binds: { handler(newValue, oldValue) { this.local_filter = { ...this.binds, ...this.received_values } }, immediate: false, // Ejecutar inmediatamente deep: true // Usar true si es un objeto/array }, received_values: { handler(newValue, oldValue) { this.local_filter = { ...this.binds, ...this.received_values } }, immediate: false, // Ejecutar inmediatamente deep: true // Usar true si es un objeto/array }, local_filter: { handler(newValue, oldValue) { if(this.helpers.loading==false){ this.Get() } }, immediate: false, // Ejecutar inmediatamente deep: true // Usar true si es un objeto/array }, ...['search', 'limit', 'sort', 'order', 'trashed', 'scope', 'date_from', 'date_to'].reduce((acc, field) => { acc[`inner_filter.${field}`] = function() { this.inner_filter.page = 1; }; return acc; }, {}), inner_filter: { inmediate:true, deep:true, handler(newId){ clearTimeout(this.timer) this.timer = setTimeout(()=>{ this.onSearch() },500) } } }, computed:{ render_header(){ let header = [] if (this.render.length>0) { this.render.forEach((field)=>{ if (field.active==='true' || field.active===true) { header.push({... { align:'start', key: field.name, sortable: true, title: field.label, } }); } }) } else { if(this.data && this.data.length>0){ header = Object.keys(this.data[0]).map(key => ({ align:'start', key: key, sortable: true, title: key.charAt(0).toUpperCase() + key.slice(1), })); } } header.push({... { align:'end', key: 'render_table_actions', sortable: false, title: '...', } }) return header }, pagination_length(){ if (!this.data) return 0; let total = this.data.count <= this.data.total ? this.data.total:this.data.count return Math.ceil(total/this.inner_filter.limit) } }, methods: { async Get(filter={}){ this.helpers.loading = true const promise = await this.$you.find('students',filter) if(promise.status == 200){ this.data = promise?.data ?? [] } this.helpers.loading = false }, onSearch() { let search = new URLSearchParams(window.location.search) let filter = { ...search, ...this.binds, ...this.inner_filter} this.Get(filter) }, async Remove() { const promise = await axios.get('/api/students/'+this.remove+'/remove'); if (promise.status==200) { this.remove = null this.pin = this.$pin(6) this.pin_verify = null this.Get() } }, async getPalette(img,item){ item['palette'] = await this.$colorPalette.getDominantColor(img) this.getContrastColor(item.palette,item) }, getContrastColor(color,item){ const contrastWithWhite = this.$colorPalette.getContrastRatio(color, '#FFFFFF') const contrastWithBlack = this.$colorPalette.getContrastRatio(color, '#000000') item['contrast'] = contrastWithWhite > contrastWithBlack ? '#FFFFFF' : '#000000' }, downloadFile(name,content){ const parts = content.split(',') if(parts.length !== 2){ alert('Invalid File') return } const typeBase64 = parts[0] const contentBase64 = parts[1] const typeMIME = typeBase64.split(';')[0].replace('data:','') const byteCharacters = atob(contentBase64) const byteNumbers = new Array(byteCharacters.length) for (let i = 0; i < byteCharacters.length; i++) { byteNumbers[i] = byteCharacters.charCodeAt(i) } const byteArray = new Uint8Array(byteNumbers) const blob = new Blob([byteArray],{type:typeMIME}) const link = document.createElement('a') link.href = URL.createObjectURL(blob) link.download = name document.body.appendChild(link) link.click() document.body.removeChild(link) }, }, mounted(){ this.onSearch() }, created(){ }, }; window.componentes.StudentsList = StudentsList; const StudentGradesList = { template: `

ph-duotone ph-list-bullets Calificacion

Score mdi-format-text Comments Graded At mdi-format-text Student Id First Name mdi-format-text Student Id Last Name mdi-dots-vertical-circle-outline mdi-dots-vertical-circle-outline
{{btn.icon || 'mdi-pointer'}} {{btn.title||'Custom Action'}}
{{btn.icon || 'mdi-pointer'}} {{btn.title||'Custom Action'}}
Details Update Delete
Show {{n*30}} Of {{data?.total ?? 0}} Eliminar Registro Ingrese el codigo: {{pin}} Eliminar Cerrar
`, data() { return { data:[], brick:{"id":"student_grades_list","owner":null,"table":"student_grades","name":"Calificacion","description":null,"method":"get","type":"all","fields":[{"name":"id","label":"Id","type":"text","hint":"This field show Id","active":false,"PK":true},{"name":"student_id","label":"Student Id","type":"relation","hint":"This field show Student Id","active":false},{"name":"school_year_id","label":"School Year Id","type":"text","hint":"This field show School Year Id","active":false},{"name":"grade_id","label":"Grade Id","type":"text","hint":"This field show Grade Id","active":false},{"name":"section_id","label":"Section Id","type":"text","hint":"This field show Section Id","active":false},{"name":"activity_id","label":"Activity Id","type":"text","hint":"This field show Activity Id","active":false},{"name":"score","label":"Score","type":"number","hint":"This field show Score","active":true},{"name":"comments","label":"Comments","type":"text","hint":"This field show Comments","active":true},{"name":"graded_at","label":"Graded At","type":"date","hint":"This field show Graded At","active":true},{"name":"created_at","label":"Created At","type":"date","hint":"This field show Created At","active":false},{"name":"updated_at","label":"Updated At","type":"date","hint":"This field show Updated At","active":false},{"name":"student_id__id","label":"Student Id Id","type":"text","hint":"This field show [Student Id Id]","active":false,"PK":true},{"name":"student_id__student_code","label":"Student Id Student Code","type":"text","hint":"This field show [Student Id Student Code]","active":false},{"name":"student_id__first_name","label":"Student Id First Name","type":"text","hint":"This field show [Student Id First Name]","active":true},{"name":"student_id__last_name","label":"Student Id Last Name","type":"text","hint":"This field show [Student Id Last Name]","active":true},{"name":"student_id__date_of_birth","label":"Student Id Date Of Birth","type":"date","hint":"This field show [Student Id Date Of Birth]","active":false},{"name":"student_id__gender","label":"Student Id Gender","type":"text","hint":"This field show [Student Id Gender]","active":false},{"name":"student_id__phone","label":"Student Id Phone","type":"text","hint":"This field show [Student Id Phone]","active":false},{"name":"student_id__email","label":"Student Id Email","type":"text","hint":"This field show [Student Id Email]","active":false},{"name":"student_id__address","label":"Student Id Address","type":"text","hint":"This field show [Student Id Address]","active":false},{"name":"student_id__school_year_id","label":"Student Id School Year Id","type":"text","hint":"This field show [Student Id School Year Id]","active":false},{"name":"student_id__grade_id","label":"Student Id Grade Id","type":"text","hint":"This field show [Student Id Grade Id]","active":false},{"name":"student_id__section_id","label":"Student Id Section Id","type":"text","hint":"This field show [Student Id Section Id]","active":false},{"name":"student_id__enrollment_status","label":"Student Id Enrollment Status","type":"text","hint":"This field show [Student Id Enrollment Status]","active":false},{"name":"student_id__created_at","label":"Student Id Created At","type":"date","hint":"This field show [Student Id Created At]","active":false},{"name":"student_id__updated_at","label":"Student Id Updated At","type":"date","hint":"This field show [Student Id Updated At]","active":false}],"template":[],"custom_template":null,"custom_functions":null,"container":{"type":"table","append":"<\/div>;","prepend":"
","gutters":true,"items-per-page":30,"items-per-row":4},"delete":1,"filter":null,"options":null,"created_at":"2026-07-06 16:19:24"}, render: [{"name":"id","label":"Id","type":"text","hint":"This field show Id","active":false,"PK":true},{"name":"student_id","label":"Student Id","type":"relation","hint":"This field show Student Id","active":false},{"name":"school_year_id","label":"School Year Id","type":"text","hint":"This field show School Year Id","active":false},{"name":"grade_id","label":"Grade Id","type":"text","hint":"This field show Grade Id","active":false},{"name":"section_id","label":"Section Id","type":"text","hint":"This field show Section Id","active":false},{"name":"activity_id","label":"Activity Id","type":"text","hint":"This field show Activity Id","active":false},{"name":"score","label":"Score","type":"number","hint":"This field show Score","active":true},{"name":"comments","label":"Comments","type":"text","hint":"This field show Comments","active":true},{"name":"graded_at","label":"Graded At","type":"date","hint":"This field show Graded At","active":true},{"name":"created_at","label":"Created At","type":"date","hint":"This field show Created At","active":false},{"name":"updated_at","label":"Updated At","type":"date","hint":"This field show Updated At","active":false},{"name":"student_id__id","label":"Student Id Id","type":"text","hint":"This field show [Student Id Id]","active":false,"PK":true},{"name":"student_id__student_code","label":"Student Id Student Code","type":"text","hint":"This field show [Student Id Student Code]","active":false},{"name":"student_id__first_name","label":"Student Id First Name","type":"text","hint":"This field show [Student Id First Name]","active":true},{"name":"student_id__last_name","label":"Student Id Last Name","type":"text","hint":"This field show [Student Id Last Name]","active":true},{"name":"student_id__date_of_birth","label":"Student Id Date Of Birth","type":"date","hint":"This field show [Student Id Date Of Birth]","active":false},{"name":"student_id__gender","label":"Student Id Gender","type":"text","hint":"This field show [Student Id Gender]","active":false},{"name":"student_id__phone","label":"Student Id Phone","type":"text","hint":"This field show [Student Id Phone]","active":false},{"name":"student_id__email","label":"Student Id Email","type":"text","hint":"This field show [Student Id Email]","active":false},{"name":"student_id__address","label":"Student Id Address","type":"text","hint":"This field show [Student Id Address]","active":false},{"name":"student_id__school_year_id","label":"Student Id School Year Id","type":"text","hint":"This field show [Student Id School Year Id]","active":false},{"name":"student_id__grade_id","label":"Student Id Grade Id","type":"text","hint":"This field show [Student Id Grade Id]","active":false},{"name":"student_id__section_id","label":"Student Id Section Id","type":"text","hint":"This field show [Student Id Section Id]","active":false},{"name":"student_id__enrollment_status","label":"Student Id Enrollment Status","type":"text","hint":"This field show [Student Id Enrollment Status]","active":false},{"name":"student_id__created_at","label":"Student Id Created At","type":"date","hint":"This field show [Student Id Created At]","active":false},{"name":"student_id__updated_at","label":"Student Id Updated At","type":"date","hint":"This field show [Student Id Updated At]","active":false}], posible_fields: {"score":null,"comments":null,"graded_at":null,"student_id__first_name":null,"student_id__last_name":null}, local_filter:{}, search:null, remove:null, pin:this.$pin(6), pin_verify:null, helpers:{ loading:false, page:1 }, inner_filter:{ search:null, limit:30, page:1 }, _skipWatch: false, timer:null }; }, props: { allow: { type: Array, default: () => [] }, attrs: { type: Object, default: () => {} }, inline:{ type: Boolean, default: false }, admin:{ type: Boolean, default: true }, binds: { type: Object, default: () => {} }, received_values: { type: Object, default: () => {} }, filter: { type: Object, default: () => {} }, ID: { type: String, required:false }, }, watch:{ binds: { handler(newValue, oldValue) { this.local_filter = { ...this.binds, ...this.received_values } }, immediate: false, // Ejecutar inmediatamente deep: true // Usar true si es un objeto/array }, received_values: { handler(newValue, oldValue) { this.local_filter = { ...this.binds, ...this.received_values } }, immediate: false, // Ejecutar inmediatamente deep: true // Usar true si es un objeto/array }, local_filter: { handler(newValue, oldValue) { if(this.helpers.loading==false){ this.Get() } }, immediate: false, // Ejecutar inmediatamente deep: true // Usar true si es un objeto/array }, ...['search', 'limit', 'sort', 'order', 'trashed', 'scope', 'date_from', 'date_to'].reduce((acc, field) => { acc[`inner_filter.${field}`] = function() { this.inner_filter.page = 1; }; return acc; }, {}), inner_filter: { inmediate:true, deep:true, handler(newId){ clearTimeout(this.timer) this.timer = setTimeout(()=>{ this.onSearch() },500) } } }, computed:{ render_header(){ let header = [] if (this.render.length>0) { this.render.forEach((field)=>{ if (field.active==='true' || field.active===true) { header.push({... { align:'start', key: field.name, sortable: true, title: field.label, } }); } }) } else { if(this.data && this.data.length>0){ header = Object.keys(this.data[0]).map(key => ({ align:'start', key: key, sortable: true, title: key.charAt(0).toUpperCase() + key.slice(1), })); } } header.push({... { align:'end', key: 'render_table_actions', sortable: false, title: '...', } }) return header }, pagination_length(){ if (!this.data) return 0; let total = this.data.count <= this.data.total ? this.data.total:this.data.count return Math.ceil(total/this.inner_filter.limit) } }, methods: { async Get(filter={}){ this.helpers.loading = true const promise = await this.$you.find('student_grades',filter) if(promise.status == 200){ this.data = promise?.data ?? [] } this.helpers.loading = false }, onSearch() { let search = new URLSearchParams(window.location.search) let filter = { ...search, ...this.binds, ...this.inner_filter} this.Get(filter) }, async Remove() { const promise = await axios.get('/api/student_grades/'+this.remove+'/remove'); if (promise.status==200) { this.remove = null this.pin = this.$pin(6) this.pin_verify = null this.Get() } }, async getPalette(img,item){ item['palette'] = await this.$colorPalette.getDominantColor(img) this.getContrastColor(item.palette,item) }, getContrastColor(color,item){ const contrastWithWhite = this.$colorPalette.getContrastRatio(color, '#FFFFFF') const contrastWithBlack = this.$colorPalette.getContrastRatio(color, '#000000') item['contrast'] = contrastWithWhite > contrastWithBlack ? '#FFFFFF' : '#000000' }, downloadFile(name,content){ const parts = content.split(',') if(parts.length !== 2){ alert('Invalid File') return } const typeBase64 = parts[0] const contentBase64 = parts[1] const typeMIME = typeBase64.split(';')[0].replace('data:','') const byteCharacters = atob(contentBase64) const byteNumbers = new Array(byteCharacters.length) for (let i = 0; i < byteCharacters.length; i++) { byteNumbers[i] = byteCharacters.charCodeAt(i) } const byteArray = new Uint8Array(byteNumbers) const blob = new Blob([byteArray],{type:typeMIME}) const link = document.createElement('a') link.href = URL.createObjectURL(blob) link.download = name document.body.appendChild(link) link.click() document.body.removeChild(link) }, }, mounted(){ this.onSearch() }, created(){ }, }; window.componentes.StudentGradesList = StudentGradesList;