Inicio del proyecto

This commit is contained in:
Andres2908
2022-01-13 20:19:22 -06:00
commit 8f4c0916f5
19 changed files with 23781 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
# editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false
+90
View File
@@ -0,0 +1,90 @@
# Created by .ignore support plugin (hsz.mobi)
### Node template
# Logs
/logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
# parcel-bundler cache (https://parceljs.org/)
.cache
# next.js build output
.next
# nuxt.js build output
.nuxt
# Nuxt generate
dist
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless
# IDE / Editor
.idea
# Service worker
sw.*
# macOS
.DS_Store
# Vim swap files
*.swp
+4
View File
@@ -0,0 +1,4 @@
{
"semi": false,
"singleQuote": true
}
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

+96
View File
@@ -0,0 +1,96 @@
<template>
<div class="full-h is-flex is-justify-content-center is-align-items-center">
<form class="box">
<div class="has-text-centered">
<h2 class="is-size-1">Nombre sistema</h2>
</div>
<b-field label="Usuario" :type="error">
<b-input type="text" @keyup.enter.native="login()" v-model="usuario" />
</b-field>
<b-field label="Contraseña" :type="error">
<b-input
type="password"
@keyup.enter.native="login()"
v-model="password"
password-reveal
/>
</b-field>
<div class="has-text-centered">
<b-button
@click="login()"
type="is-success"
:disabled="error || !(usuario && password)"
>
Iniciar Sesión
</b-button>
</div>
</form>
</div>
</template>
<script>
import axios from 'axios'
export default {
props: {
imprimirMensaje: { type: Function, required: true },
imprimirWarning: { type: Function, required: true },
imprimirError: { type: Function, required: true },
updateIsLoading: { type: Function, required: true },
},
data() {
return {
usuario: '',
password: '',
error: '',
}
},
methods: {
login() {
if (this.usuario && this.password && !this.error) {
const data = {
usuario: this.usuario,
password: this.password,
}
this.updateIsLoading(true)
axios
.post(`${process.env.api}/usuario/login`, data)
.then((res) => {
const info = res.data
localStorage.setItem('token', info.token)
this.updateIsLoading(false)
this.$router.push(`/${''}`)
})
.catch((err) => {
this.error = 'is-danger'
this.updateIsLoading(false)
this.imprimirError(err.response.data)
})
}
},
},
watch: {
password() {
if (this.error) this.error = ''
},
usuario() {
if (this.error) this.error = ''
},
},
}
</script>
<style scoped>
.full-h {
height: 75vh;
}
form {
width: 30rem;
}
</style>
+32
View File
@@ -0,0 +1,32 @@
<template>
<footer class="footer">
<div class="container has-text-centered is-size-7 has-text-white">
<p>Hecho en México, todos los derechos reservados {{ year() }}.</p>
<p>
Esta página puede ser reproducida con fines no lucrativos, siempre y
cuando no se mutile, se cite la fuente completa y su dirección
electrónica. De otra forma, requiere permiso previo por escrito de la
institución.
</p>
</div>
</footer>
</template>
<script>
import moment from 'moment'
export default {
methods: {
year() {
return moment().year()
},
},
}
</script>
<style scoped>
footer {
background-color: #1d3d6f;
}
</style>
+41
View File
@@ -0,0 +1,41 @@
<template>
<header>
<div class="container py-3">
<div
class="
columns
is-mobile is-gapless is-vcentered is-justify-content-space-between
"
>
<a
href="https://www.unam.mx/"
class="column is-5-mobile is-3-tablet is-one-fifth-widescreen ml-3"
target="_blank"
>
<b-image :src="require('@/assets/logo_unam.png')" alt="logo_unam" />
</a>
<a
href="https://www.acatlan.unam.mx/"
class="column is-5-mobile is-3-tablet is-one-fifth-widescreen mr-3"
target="_blank"
>
<b-image
:src="require('@/assets/logo_acatlan.png')"
alt="logo_acatlan"
/>
</a>
</div>
</div>
</header>
</template>
<script>
export default {}
</script>
<style scoped>
header {
background-color: #1d3d6f;
}
</style>
+50
View File
@@ -0,0 +1,50 @@
<template>
<section>
<div class="container is-flex is-justify-content-flex-end">
<!-- <div
class="
container
is-flex is-justify-content-space-between is-align-items-center
"
>
<h2 class="m-2 has-text-white">{{ usuario }}</h2> -->
<b-button
type="is-danger"
size="is-small"
class="m-2 rojo"
@click="cerrarSesion()"
>
Cerrar Sesión
</b-button>
</div>
</section>
</template>
<script>
export default {
// data() {
// return { usuario: localStorage.getItem('usuario') }
// },
methods: {
cerrarSesion() {
localStorage.clear()
this.$router.push('/')
},
},
created() {
// if (!localStorage.getItem(''))
// this.cerrarSesion()
},
}
</script>
<style scoped>
section {
background-color: #bb8704;
}
.rojo {
background-color: #dc3545;
}
</style>
+12
View File
@@ -0,0 +1,12 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"~/*": ["./*"],
"@/*": ["./*"],
"~~/*": ["./*"],
"@@/*": ["./*"]
}
},
"exclude": ["node_modules", ".nuxt", "dist"]
}
+27
View File
@@ -0,0 +1,27 @@
<template>
<div>
<Header />
<Logout />
<nuxt />
<Footer />
</div>
</template>
<script>
import Header from '@/components/layouts/Header'
import Footer from '@/components/layouts/Footer'
import Logout from '@/components/layouts/Logout'
export default {
components: {
Header,
Footer,
Logout,
},
}
</script>
<style scoped></style>
+48
View File
@@ -0,0 +1,48 @@
<template>
<section class="hero is-light is-bold is-large">
<div class="container hero-body">
<transition name="slide-fade" appear>
<div class="columns is-vcentered">
<div class="column animate__animated animate__fadeIn animate__slow">
<b-image :src="require('@/assets/404.webp')" alt="404_image" />
</div>
<div class="column">
<h1 class="title">ERROR 404 LA PÁGINA NO HA SIDO ENCONTRADA</h1>
<b-button class="is-dark" outlined @click="regresar()">
Ir a la página principal
</b-button>
</div>
</div>
</transition>
</div>
</section>
</template>
<script>
export default {
methods: {
regresar() {
this.$router.push('/')
},
},
layout: 'login',
}
</script>
<style scoped>
.slide-fade-enter-active {
transition: all 2s ease;
}
.slide-fade-leave-active {
transition: all 0.8s cubic-bezier(1, 0.5, 0.8, 1);
}
.slide-fade-enter,
.slide-fade-leave-to {
transform: translateX(10px);
opacity: 0;
}
</style>
+23
View File
@@ -0,0 +1,23 @@
<template>
<div>
<Header />
<nuxt />
<Footer />
</div>
</template>
<script>
import Header from '@/components/layouts/Header'
import Footer from '@/components/layouts/Footer'
export default {
components: {
Header,
Footer,
},
}
</script>
<style scoped></style>
+32
View File
@@ -0,0 +1,32 @@
export default {
ssr: false,
/* Server de pruebas */
// server: { port: },
server: { port: 8080 },
target: 'static',
head: {
title: 'nuxt_buefy',
htmlAttrs: {
lang: 'es',
},
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: '' },
],
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
},
css: [],
plugins: [],
components: true,
buildModules: [],
modules: ['nuxt-buefy', '@nuxtjs/axios'],
axios: {},
build: {},
env: {
// api: "http://localhost:3000",
// api: "https://890af9d598a4.ngrok.io"
// api: "https://venus.acatlan.unam.mx/pruebas",
// api: "https://venus.acatlan.unam.mx/produccion",
},
}
+23184
View File
File diff suppressed because it is too large Load Diff
+25
View File
@@ -0,0 +1,25 @@
{
"name": "nuxt_buefy",
"version": "1.0.0",
"private": true,
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"start": "nuxt start",
"generate": "nuxt generate"
},
"dependencies": {
"@nuxtjs/axios": "^5.13.1",
"core-js": "^3.9.1",
"moment": "^2.29.1",
"nuxt": "^2.15.3",
"nuxt-buefy": "^0.4.4",
"validator": "^13.6.0"
},
"devDependencies": {
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-prettier": "^3.3.1",
"nuxt-fontawesome": "^0.4.0",
"prettier": "^2.2.1"
}
}
+104
View File
@@ -0,0 +1,104 @@
<template>
<section class="container">
<Login
:imprimirMensaje="imprimirMensaje"
:imprimirWarning="imprimirWarning"
:imprimirError="imprimirError"
:updateIsLoading="updateIsLoading"
/>
<b-loading :is-full-page="true" v-model="isLoading" :can-cancel="false" />
</section>
</template>
<script>
import Login from '@/components/Login'
export default {
components: { Login },
data() {
return {
// admin: '',
isLoading: false,
}
},
methods: {
updateIsLoading(booleanValue) {
this.isLoading = booleanValue
},
imprimirError(err = {}, title = '¡Hubo un error!', onConfirm = () => {}) {
this.$buefy.dialog.alert({
ariaRole: 'alertdialog',
ariaModal: true,
type: 'is-danger',
title,
message: err.message,
confirmText: 'Entendido',
hasIcon: true,
iconPack: 'mdi',
icon: 'alert-octagon',
onConfirm: () => onConfirm(),
})
if (err.err && err.err === 'token error') {
localStorage.clear()
this.$router.push('/')
}
},
imprimirMensaje(message, title = '¡Felicidades!', onConfirm = () => {}) {
this.$buefy.dialog.alert({
ariaRole: 'alertdialog',
ariaModal: true,
type: 'is-success',
title,
message,
confirmText: 'Ok',
hasIcon: true,
iconPack: 'mdi',
icon: 'check-circle',
onConfirm: () => onConfirm(),
})
},
imprimirWarning(
message,
onConfirm = () => {},
title = '¡Espera un minuto!',
onCancel = () => {}
) {
this.$buefy.dialog.alert({
ariaRole: 'alertdialog',
ariaModal: true,
type: 'is-warning',
title,
message,
confirmText: 'Confirmar',
canCancel: true,
cancelText: 'Cancelar',
hasIcon: true,
iconPack: 'mdi',
icon: 'help-circle',
onConfirm: () => onConfirm(),
onCancel: () => onCancel(),
})
},
// getLocalhostInfo() {
// this.admin.idUsuario = Number(localStorage.getItem('idUsuario'))
// this.admin.idTipoUsuario = Number(localStorage.getItem('idTipoUsuario'))
// this.admin.tipoUsuario = localStorage.getItem('tipoUsuario')
// this.admin.token = {
// headers: {
// token: localStorage.getItem('token'),
// },
// }
// },
},
created() {
// this.getLocalhostInfo()
// if (this.admin.idTipoUsuario === 2) this.$router.push('/responsable')
// if (this.admin.idTipoUsuario === 3) this.$router.push('/alumno')
// if (this.admin.idTipoUsuario === 4) this.$router.push('/casoEspecial')
},
layout: 'login',
}
</script>
<style scoped></style>
Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB