-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merging pull request #110 from fga-gpp-mds/us07_visualizar_gpa
- Loading branch information
Showing
5 changed files
with
197 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
<template> | ||
<div class="gpa"> | ||
<!-- <div class="card-body"> --> | ||
<div class="row align-itens-arround"> | ||
<div class="col-5 align-content-center"> | ||
<p class="card-text"> | ||
<div class="number-circle"> | ||
<div class="gpa-font v-green" v-if="gpa > 3"> | ||
{{gpa}} | ||
</div> | ||
<div class="gpa-font v-red" v-else-if="gpa < 2"> | ||
{{gpa}} | ||
</div> | ||
<div class="gpa-font v-yellow" v-else-if="gpa >= 2 && gpa <= 3"> | ||
{{gpa}} | ||
</div> | ||
<h4> GPA </h4> | ||
</div> | ||
</p> | ||
</div> | ||
<div class="col"> | ||
<p class="card-text text-justify"> </p> | ||
</div> | ||
</div> | ||
<!-- </div> --> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import {HTTP} from '../http-common.js'; | ||
export default { | ||
props: ['projectId'], | ||
data() { | ||
return { | ||
gpa: 0 | ||
} | ||
}, | ||
methods: { | ||
async getGpa() { | ||
var token = localStorage.getItem('token'); | ||
var tokenSimple = token.replace(/"/, ""); | ||
var tokenSimple2 = tokenSimple.replace(/"/, ""); | ||
var headers = { 'Authorization':tokenSimple2 }; | ||
try { | ||
let response = await HTTP.get(`projects/${ this.$route.params.id }`, { headers:headers }); | ||
let id = response.data.id; | ||
console.log(id); | ||
const result2 = await HTTP.get(`projects/${id}/gpa`, { headers: headers }); | ||
console.log(result2); | ||
this.gpa = result2.data; | ||
} catch(err) { | ||
console.log(err) | ||
} | ||
} | ||
}, | ||
mounted() { | ||
this.getGpa(); | ||
} | ||
}; | ||
</script> | ||
|
||
<style> | ||
.number-circle { | ||
font: 32px Arial, sans-serif; | ||
width: 2.5em; | ||
height: 2.5em; | ||
box-sizing: initial; | ||
background: #fff; | ||
border: 0.2em solid #7799A5; | ||
border-style: solid; | ||
color: #7799A5; | ||
text-align: center; | ||
border-radius: 50%; | ||
line-height: 2.5em; | ||
box-sizing: content-box; | ||
top: 50%; | ||
left: 50%; | ||
} | ||
.gpa-font { | ||
font-weight:bolder; | ||
font-size:1.2em; | ||
} | ||
.v-red{ | ||
color: red; | ||
} | ||
.v-yellow{ | ||
color: yellow; | ||
} | ||
.v-green{ | ||
color: green; | ||
} | ||
h4 { | ||
margin-top: 0.5em; | ||
font-weight:bolder; | ||
} | ||
</style>> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters