Skip to content

Commit ff49da1

Browse files
Merge pull request VitorCarvalho67#87 from VitorCarvalho67/dev
Dev
2 parents bf4f040 + ba51429 commit ff49da1

File tree

6 files changed

+182
-22
lines changed

6 files changed

+182
-22
lines changed

client/src/scss/pages/aluno/_config.scss

+22-2
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,26 @@ main {
109109
}
110110
}
111111

112+
#getCurriculo {
113+
margin-top: 20px;
114+
@include font-inter(400);
115+
@include flex-center;
116+
117+
p {
118+
font-size: 1rem;
119+
margin-right: 10px;
120+
color: $font-color-dark;
121+
}
122+
123+
button {
124+
background-color: $secondary-color-orange;
125+
color: $secondary-color-dark;
126+
padding: 5px 10px;
127+
border-radius: 5px;
128+
border: none;
129+
}
130+
}
131+
112132
ul {
113133
margin: 20px 0px 40px 0px;
114134
list-style: none;
@@ -155,10 +175,10 @@ main {
155175
padding: 5px 10px;
156176
background-color: $secondary-color-orange;
157177
border-radius: 3px;
158-
border: transparent 1px solid;
178+
border: transparent 1px solid;
159179
cursor: pointer;
160180

161-
img{
181+
img {
162182
width: 20px;
163183
margin-right: 10px;
164184
}

client/src/scss/pages/aluno/_profile.scss

+22-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,6 @@ main {
211211
margin-left: 170px;
212212
}
213213

214-
215214
.box1 h1 {
216215
@include font-inter(300);
217216
font-size: 2rem;
@@ -249,12 +248,34 @@ main {
249248
h2 {
250249
@include font-inter(700);
251250
font-size: 1.5rem;
251+
width: 100%;
252252
color: $secondary-color-orange;
253253
margin: 20px 0px 10px 0px;
254+
@include flex(row, space-between, center);
254255

255256
@include m-screen(760px) {
256257
font-size: 1.3rem;
257258
}
259+
260+
#getCurriculo {
261+
@include flex-center;
262+
263+
p{
264+
font-size: 1rem;
265+
margin-right: 10px;
266+
color: $font-color-dark;
267+
font-weight: 400;
268+
}
269+
270+
button {
271+
background-color: $secondary-color-orange;
272+
color: $secondary-color-dark;
273+
padding: 5px 10px;
274+
border-radius: 5px;
275+
border: none;
276+
font-weight: 400;
277+
}
278+
}
258279
}
259280

260281
> div {

client/src/scss/pages/shared/_perfilAluno.scss

+4-2
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,16 @@ main {
124124
}
125125
}
126126

127-
button {
127+
a, button {
128128
background-color: $secondary-color-orange;
129129
color: $primary-color-dark;
130130
border-radius: 5px;
131131
padding: 5px 10px;
132+
text-decoration: none;
132133
border: none;
133134
cursor: pointer;
134135
@include font-inter(400);
136+
margin-right: 15px
135137
}
136138
}
137139
}
@@ -291,7 +293,7 @@ main {
291293
border-radius: 8px;
292294
margin-bottom: 5px;
293295
@include flex(column, flex-start, flex-start);
294-
flex: 1 1 300px;
296+
flex: 1 1 auto;
295297
max-width: 400px;
296298

297299
p {

client/src/views/aluno/Config.vue

+10-8
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,7 @@
99
Configure seu perfil e veja suas informações
1010
</h2>
1111

12-
<div id="getCurriculo">
13-
<button @click="GetCurriculoFile" v-if="linkstatus == 0">Gerar Currículo</button>
14-
<p v-if="linkstatus == 1">Gerando currículo</p>
15-
<p v-if="linkstatus == 2">Currículo gerado</p>
16-
<a v-if="linkstatus == 2">
17-
<button @click="downloadFile">Baixar</button>
18-
</a>
19-
</div>
12+
2013

2114
<h3>Envio de boletim</h3>
2215

@@ -34,6 +27,15 @@
3427
</div>
3528

3629
<h3>Seus dados</h3>
30+
31+
<div id="getCurriculo">
32+
<button @click="GetCurriculoFile" v-if="linkstatus == 0">Gerar Currículo</button>
33+
<p v-if="linkstatus == 1">Gerando currículo</p>
34+
<p v-if="linkstatus == 2">Currículo gerado</p>
35+
<a v-if="linkstatus == 2">
36+
<button @click="downloadFile">Baixar</button>
37+
</a>
38+
</div>
3739

3840
<ul>
3941
<li>

client/src/views/aluno/Profile.vue

+115-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,17 @@
5959
</div>
6060
</div>
6161
<section class="sobreMim">
62-
<h2>Sobre mim</h2>
62+
<h2>
63+
Sobre mim
64+
<div id="getCurriculo">
65+
<button @click="GetCurriculoFile" v-if="linkstatus == 0">Gerar Currículo</button>
66+
<p v-if="linkstatus == 1">Gerando currículo</p>
67+
<p v-if="linkstatus == 2">Currículo gerado</p>
68+
<a v-if="linkstatus == 2">
69+
<button @click="downloadFile">Baixar</button>
70+
</a>
71+
</div>
72+
</h2>
6373
<div>
6474
<p v-show="mode === 'view'" v-html="aluno.curriculo"></p>
6575
<textarea v-show="mode === 'edit'" name="" cols="30" rows="10" id="edit"
@@ -176,6 +186,8 @@ import {
176186
editExtracurricular,
177187
deleteExtracurricular,
178188
getExtracurriculares,
189+
getCurriculoFile
190+
179191
} from "../../services/api/aluno";
180192
import { getImage, getBanner } from "../../services/api/shared";
181193
import { mixinAluno } from "../../util/authMixins";
@@ -199,9 +211,14 @@ export default {
199211
email: "",
200212
curriculo: "",
201213
curriculoEdit: "",
202-
imgUrl: "default",
214+
token: "",
215+
imgUrl: "../../assets/img/defaultImage.png",
203216
bannerUrl: "default",
217+
link_curriculo: ""
204218
},
219+
file: "",
220+
fileSelected: false,
221+
linkstatus: 0,
205222
mode: "view",
206223
modeImage: "view",
207224
modeBanner: "view",
@@ -522,6 +539,102 @@ export default {
522539
}
523540
},
524541
542+
async getData() {
543+
const response = await getCurriculo(this.aluno.token);
544+
545+
try {
546+
if (response.status >= 200 && response.status < 300) {
547+
this.aluno.curriculo = response.data.curriculo.replace(
548+
/\n/g,
549+
"<br>",
550+
);
551+
this.aluno.curriculoEdit = response.data.curriculo;
552+
this.aluno.endereco = response.data.endereco;
553+
this.aluno.nascimento = response.data.nascimento;
554+
this.calcularIdade(this.aluno.nascimento);
555+
this.aluno.nascimento = this.aluno.nascimento
556+
.split("T")[0]
557+
.split("-")
558+
.reverse()
559+
.join("/");
560+
this.aluno.nome = response.data.nome;
561+
this.aluno.email = response.data.email;
562+
this.aluno.rm = response.data.rm;
563+
this.aluno.quantidadeVinculos = response.data.quantidadeVinculos;
564+
} else {
565+
alert(
566+
"Ops.. Algo deu errado ao recuperar os dados. 😕\n" +
567+
response.message,
568+
);
569+
}
570+
} catch (error) {
571+
alert(
572+
"Ops.. Algo deu errado ao recuperar os dados. 😕\n" + error,
573+
);
574+
}
575+
576+
try {
577+
const response = await getImage({
578+
identifier: "ALUNO",
579+
email: this.aluno.email,
580+
});
581+
582+
if (response.status >= 200 && response.status < 300) {
583+
this.aluno.imageUrl = response.data.url;
584+
} else {
585+
console.log(
586+
"Ops.. Algo deu errado ao recuperar a imagem. 😕\n" +
587+
response.message,
588+
);
589+
}
590+
} catch (error) {
591+
console.log(
592+
"Ops.. Algo deu errado ao recuperar a imagem de perfil. 😕\n" +
593+
error,
594+
);
595+
}
596+
},
597+
async GetCurriculoFile() {
598+
this.linkstatus = 1;
599+
const response = await getCurriculoFile(this.aluno.token);
600+
601+
if (response.status >= 200 && response.status < 300) {
602+
console.log(response);
603+
this.aluno.link_curriculo = response.data.url;
604+
605+
this.linkstatus = 2;
606+
} else {
607+
alert(
608+
"Ops.. Algo deu errado ao gerar currículo. 😕\n" +
609+
response.message,
610+
);
611+
}
612+
},
613+
async downloadFile() {
614+
try {
615+
const response = await fetch(this.aluno.link_curriculo);
616+
617+
if (!response.ok) {
618+
throw new Error('Falha no download do arquivo.');
619+
}
620+
621+
const blob = await response.blob();
622+
623+
const blobUrl = window.URL.createObjectURL(blob);
624+
625+
const link = document.createElement('a');
626+
link.href = blobUrl;
627+
link.setAttribute('download', 'Curriculo.pdf');
628+
document.body.appendChild(link);
629+
link.click();
630+
631+
window.URL.revokeObjectURL(blobUrl);
632+
document.body.removeChild(link);
633+
} catch (error) {
634+
console.error('Erro ao baixar o arquivo:', error);
635+
}
636+
},
637+
525638
cancelAdd() {
526639
this.showAddForm = false;
527640
this.newActivity = {

client/src/views/shared/PerfilAluno.vue

+9-7
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
@click="sendSolicitation">Vincular-se</button>
2525

2626
<router-link v-show="visualizador.conected && !visualizador.isOwner"
27-
:to="'/mensagens/aluno/' + aluno.email">Mensagem</router-link>
27+
:to="'/mensagens/aluno/' + aluno.email">Conversar</router-link>
2828

2929
<button v-show="visualizador.situacao == 'recebido'" @click="acceptSolicitation">Aceitar
3030
pedido</button>
@@ -46,12 +46,14 @@
4646
<section class="extracurriculares">
4747
<h2>Atividades Extracurriculares</h2>
4848

49-
<div v-for="(activity, index) in aluno.extracurriculares" :key="activity.id" class="activity">
50-
<div>
51-
<p><strong>Instituição:</strong> {{ activity.instituicao }}</p>
52-
<p><strong>Descrição:</strong> {{ activity.descricao }}</p>
53-
<p><strong>Início:</strong> {{ formatDate(activity.inicio) }}</p>
54-
<p><strong>Fim:</strong> {{ formatDate(activity.fim) }}</p>
49+
<div class="activities">
50+
<div v-for="(activity, index) in aluno.extracurriculares" :key="activity.id" class="activity">
51+
<div>
52+
<p><strong>Instituição:</strong> {{ activity.instituicao }}</p>
53+
<p><strong>Descrição:</strong> {{ activity.descricao }}</p>
54+
<p><strong>Início:</strong> {{ formatDate(activity.inicio) }}</p>
55+
<p><strong>Fim:</strong> {{ formatDate(activity.fim) }}</p>
56+
</div>
5557
</div>
5658
</div>
5759
</section>

0 commit comments

Comments
 (0)