64 lines
1.3 KiB
Vue
64 lines
1.3 KiB
Vue
![]() |
<template>
|
||
|
<b-table
|
||
|
:data="data"
|
||
|
:loading="isLoadingTable"
|
||
|
show-detail-icon
|
||
|
paginated
|
||
|
detailed
|
||
|
>
|
||
|
<b-table-column field="modulo" label="Modulo" v-slot="props" centered>
|
||
|
<span>{{ props.row.modulo }}</span>
|
||
|
</b-table-column>
|
||
|
|
||
|
<b-table-column field="activo" label="Activo" v-slot="props" centered>
|
||
|
<span>{{ props.row.activo }}</span>
|
||
|
</b-table-column>
|
||
|
</b-table>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
import axios from 'axios'
|
||
|
export default {
|
||
|
props: {
|
||
|
admin: {
|
||
|
typeof: Object,
|
||
|
require: true,
|
||
|
},
|
||
|
updateActualizarTabla: { type: Function, required: true },
|
||
|
actualizarTabla: { type: Boolean, required: true },
|
||
|
},
|
||
|
data() {
|
||
|
return {
|
||
|
isLoadingTable: false,
|
||
|
data: [],
|
||
|
}
|
||
|
},
|
||
|
methods: {
|
||
|
obtenerModulos() {
|
||
|
axios
|
||
|
.get(
|
||
|
`${process.env.api}/modulo?id_institucion=${this.admin.operador.institucion.id_institucion}`
|
||
|
)
|
||
|
.then((res) => {
|
||
|
this.data = res.data
|
||
|
})
|
||
|
.catch((err) => {
|
||
|
this.imprimirError(err)
|
||
|
})
|
||
|
},
|
||
|
},
|
||
|
watch: {
|
||
|
actualizarTabla() {
|
||
|
console.log('hola')
|
||
|
if (this.actualizarTabla) {
|
||
|
this.obtenerModulos()
|
||
|
this.updateActualizarTabla(false)
|
||
|
}
|
||
|
},
|
||
|
},
|
||
|
created() {
|
||
|
this.obtenerModulos()
|
||
|
},
|
||
|
}
|
||
|
</script>
|