Skip to content

Commit 0cec2ee

Browse files
Merge pull request #110 from Daniel-Alvarenga/main
Add professor profile
2 parents 98d94fd + b08216b commit 0cec2ee

File tree

19 files changed

+884
-46
lines changed

19 files changed

+884
-46
lines changed
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
<template>
2+
<aside :class="['aside-dashboard', view, { fixed: isFixed && view === 'yeah' }]">
3+
<div>
4+
<ul>
5+
<li :class="getClassForPage('home')">
6+
<router-link to="/empresa">
7+
<img :src="icons.home">
8+
<p v-if="showPs">Home</p>
9+
</router-link>
10+
</li>
11+
<li :class="getClassForPage('message')">
12+
<router-link to="/empresa/mensagens">
13+
<img :src="icons.send" />
14+
<p v-if="showPs">Mensagens</p>
15+
</router-link>
16+
</li>
17+
<li :class="getClassForPage('estagios')">
18+
<router-link to="/empresa/vagas">
19+
<img :src="icons.formIcon" />
20+
<p v-if="showPs">Atividades</p>
21+
</router-link>
22+
</li>
23+
<li :class="getClassForPage('rankings')">
24+
<router-link to="/empresa/ranking">
25+
<img :src="icons.ranking" />
26+
<p v-if="showPs">Rankings</p>
27+
</router-link>
28+
</li>
29+
</ul>
30+
</div>
31+
<button @click="changePsVisualization">
32+
<img :src="icons.angulo" alt="<">
33+
</button>
34+
</aside>
35+
</template>
36+
37+
<script>
38+
import { defineComponent } from 'vue';
39+
import { useRouter } from 'vue-router';
40+
41+
// icons
42+
import homeIcon from '../../assets/icons/casa.png';
43+
import searchIcon from '../../assets/icons/procurar.png';
44+
import linkIcon from '../../assets/icons/link.png';
45+
import sendIcon from '../../assets/icons/aviao-de-papel.png';
46+
import jobIcon from '../../assets/icons/estagio.png';
47+
import rankingIcon from '../../assets/icons/trofeu.png';
48+
import anguloIcon from '../../assets/icons/angulo.png';
49+
import userIcon from '../../assets/icons/user.png';
50+
import configIcon from '../../assets/icons/config.png';
51+
import formIcon from '../../assets/icons/forma.png';
52+
import tablesIcon from '../../assets/icons/grafico-horizontal-simples.png';
53+
54+
55+
export default defineComponent({
56+
name: 'AsideDashboard',
57+
emits: ['close'],
58+
props: {
59+
pageName: {
60+
type: String,
61+
required: true
62+
}
63+
},
64+
data() {
65+
return {
66+
icons: {
67+
home: homeIcon,
68+
search: searchIcon,
69+
link: linkIcon,
70+
send: sendIcon,
71+
job: jobIcon,
72+
ranking: rankingIcon,
73+
angulo: anguloIcon,
74+
user: userIcon,
75+
config: configIcon,
76+
form: formIcon,
77+
table: tablesIcon
78+
},
79+
showPs: true,
80+
view: 'yeah',
81+
isFixed: false
82+
}
83+
},
84+
methods: {
85+
getClassForPage(pageLoad) {
86+
return this.pageName === pageLoad ? "page" : "";
87+
},
88+
changePsVisualization() {
89+
this.showPs = !this.showPs;
90+
this.view = this.showPs ? 'yeah' : 'none';
91+
localStorage.setItem('asideDashboardState', JSON.stringify({
92+
showPs: this.showPs,
93+
view: this.view
94+
}));
95+
this.updateFixedState();
96+
},
97+
loadStateFromStorage() {
98+
const state = localStorage.getItem('asideDashboardState');
99+
if (state) {
100+
const parsedState = JSON.parse(state);
101+
this.showPs = parsedState.showPs;
102+
this.view = parsedState.view;
103+
}
104+
},
105+
checkScreenWidth() {
106+
if (window.innerWidth < 1000) {
107+
this.showPs = false;
108+
this.view = 'none';
109+
this.updateFixedState();
110+
} else {
111+
this.isFixed = false;
112+
if (this.showPs) {
113+
this.view = 'yeah';
114+
}
115+
}
116+
localStorage.setItem('asideDashboardState', JSON.stringify({
117+
showPs: this.showPs,
118+
view: this.view
119+
}));
120+
},
121+
updateFixedState() {
122+
this.isFixed = (this.view === 'yeah' && window.innerWidth < 1000);
123+
}
124+
},
125+
mounted() {
126+
this.loadStateFromStorage();
127+
this.checkScreenWidth();
128+
window.addEventListener('resize', this.checkScreenWidth);
129+
},
130+
beforeUnmount() {
131+
window.removeEventListener('resize', this.checkScreenWidth);
132+
}
133+
});
134+
</script>
135+
136+
<style lang="scss" scoped>
137+
@import "../../scss/layouts/aluno/_asideDashboard.scss";
138+
</style>

client/src/services/api/professor.js

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,4 +133,64 @@ export const sendMessage = async (infoMesssage, token) => {
133133
} catch (error) {
134134
return error.data;
135135
}
136+
}
137+
138+
export const getCurriculo = async (token) => {
139+
try {
140+
const response = await api.get('professor/curriculo', {
141+
headers: {
142+
authorization: `${token}`
143+
}
144+
});
145+
return response;
146+
} catch (error) {
147+
return error.data;
148+
}
149+
}
150+
151+
export const updateCurriculo = async (curriculo, token) => {
152+
try {
153+
const response = await api.post('professor/curriculo/update', curriculo, {
154+
headers: {
155+
authorization: `${token}`
156+
}
157+
});
158+
return response;
159+
} catch (error) {
160+
return error.response.data;
161+
}
162+
}
163+
164+
export const updateImage = async (file, token) => {
165+
try {
166+
const formData = new FormData();
167+
formData.append('file', file);
168+
169+
const response = await api.post('professor/upload/image/profile', formData, {
170+
headers: {
171+
authorization: `${token}`,
172+
'Content-Type': 'multipart/form-data'
173+
}
174+
});
175+
return response;
176+
} catch (error) {
177+
return error.response.data;
178+
}
179+
}
180+
181+
export const updateBanner = async (file, token) => {
182+
try {
183+
const formData = new FormData();
184+
formData.append('file', file);
185+
186+
const response = await api.post('professor/upload/image/banner', formData, {
187+
headers: {
188+
authorization: `${token}`,
189+
'Content-Type': 'multipart/form-data'
190+
}
191+
});
192+
return response;
193+
} catch (error) {
194+
return error.response.data;
195+
}
136196
}

client/src/views/aluno/Ranking.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@
66
<section class="content">
77
<div class="box" id="box1">
88
<H1>Rankings</H1>
9+
<<<<<<< HEAD
10+
<h2>Ranking gerado a partir das notas dos alunos. O objetivo desse ranking é proporcionar competitividade e destacar os alunos para as empresas.</h2>
11+
12+
=======
913
<h2>Ranking gerados a partir das notas dos alunos. O objetivo desse ranking é proporcionar
1014
competitividade e destacar os alunos para as empresas.</h2>
1115

16+
>>>>>>> 98d94fd9c72eb7e19323bc31ba76f488af0a0271
1217
<div class="alunos">
1318
<p class="info">Ranking geral:</p>
1419

@@ -21,7 +26,7 @@
2126
<img v-if="item.aluno.imagem != 'default'" :src="item.aluno.imagem" alt="Foto do aluno">
2227
<img v-else src="../../assets/icons/artwork.png" alt="Foto padrão">
2328
<p class="name">{{ item.aluno.nome }} - 3º DS</p>
24-
<p class="pontos">{{ (item.rankingNota * 1000).toFixed(2) }} pontos</p>
29+
<p class="pontos">{{ (item.rankingNota * 1000).toFixed(2) }} / {{ item.numeroNotas }}</p>
2530
</router-link>
2631
</div>
2732
</div>

client/src/views/empresa/Ranking.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<img v-if="item.aluno.imagem != 'default'" :src="item.aluno.imagem" alt="Foto do aluno">
1818
<img v-else src="../../assets/icons/artwork.png" alt="Foto padrão">
1919
<p class="name">{{ item.aluno.nome }} - 3º DS</p>
20-
<p class="pontos">{{ (item.rankingNota * 1000).toFixed(2) }} pontos</p>
20+
<p class="pontos">{{ (item.rankingNota * 1000).toFixed(2) }} / {{ item.numeroNotas }}</p>
2121
</router-link>
2222
</div>
2323
</div>

0 commit comments

Comments
 (0)