","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: `
`,
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'}}
mdi-eye-outline
Details
mdi-pencil
Update
mdi-delete
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'}}
mdi-eye-outline
Details
mdi-pencil
Update
mdi-delete
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;