From 58c7ac9caada0a336c4f5407e7b81dfb73bec88e Mon Sep 17 00:00:00 2001 From: VitorCarvalho67 Date: Sun, 24 Nov 2024 23:09:14 -0300 Subject: [PATCH] Update empresa profile --- client/src/scss/pages/empresa/_dashboard.scss | 122 ++++++++++++++- client/src/views/aluno/PerfilEmpresa.vue | 133 ++++++++-------- client/src/views/shared/PerfilEmpresa.vue | 146 ++++++++++-------- 3 files changed, 266 insertions(+), 135 deletions(-) diff --git a/client/src/scss/pages/empresa/_dashboard.scss b/client/src/scss/pages/empresa/_dashboard.scss index 335ca88..4ad046f 100644 --- a/client/src/scss/pages/empresa/_dashboard.scss +++ b/client/src/scss/pages/empresa/_dashboard.scss @@ -317,6 +317,11 @@ main { @include m-screen(760px) { font-size: 0.9rem; } + + a{ + text-decoration: none; + color: $font-color-dark + } } } } @@ -332,12 +337,127 @@ main { margin-top: 60px; } + .vagas{ + width: 100%; + } + + .vaga { + @include flex(column, flex-end, start); + width: 70%; + height: 140px; + border-left: solid 5px $secondary-color-orange; + margin-bottom: 10px; + + @include m-screen(1000px) { + height: auto; + } + + a { + @include flex(row, space-between, start); + width: 100%; + height: 100%; + background-color: $secondary-color-dark; + padding: 15px; + border-radius: 5px; + text-decoration: none; + color: $font-color-dark; + + img { + height: 60px; + width: 60px; + object-fit: cover; + border-radius: 50%; + margin-right: 20px; + } + + .infoVaga { + @include flex(row, space-between, start); + width: 100%; + height: 100%; + padding-right: 20px; + + @include m-screen(1000px) { + @include flex(row, space-between, center); + } + + @include m-screen(600px) { + @include flex(column, space-between, start); + } + + .who { + color: $primary-color-orange; + margin-right: 10px; + margin-bottom: 10px; + } + + .contentVaga { + @include flex(column, flex-start, start); + width: calc(100% - 120px); + + @include m-screen(600px) { + width: 100%; + margin-bottom: 10px; + } + + .info { + @include flex(row, start, start); + width: 100%; + + @include m-screen(1000px) { + @include flex(column, start, start); + margin-top: 5px; + } + + label { + @include font-inter(300); + color: $font-color-dark-2; + min-width: 30%; + } + + p { + @include font-inter(300); + color: $font-color-dark; + } + } + } + + .box-button { + height: 100%; + @include flex(column, center, center); + + @include m-screen(600px) { + width: 100%; + @include flex(column, center, end); + } + + button { + padding: 10px 20px; + border-radius: 10px; + font-size: 1rem; + border: solid 1px $secondary-color-orange; + background-color: $secondary-color-dark; + color: $secondary-color-orange; + + &:hover { + color: $secondary-color-dark; + background-color: $secondary-color-orange; + } + } + } + } + + p { + @include font-inter(600); + } + } + } + h2 { @include font-inter(700); font-size: 1.5rem; width: 100%; color: $secondary-color-orange; - margin: 20px 0px 10px 0px; + margin: 20px 0px 30px 0px; @include flex(row, space-between, center); @include m-screen(760px) { diff --git a/client/src/views/aluno/PerfilEmpresa.vue b/client/src/views/aluno/PerfilEmpresa.vue index a27941a..228c52d 100644 --- a/client/src/views/aluno/PerfilEmpresa.vue +++ b/client/src/views/aluno/PerfilEmpresa.vue @@ -12,30 +12,63 @@
- Capa + Capa Capa
- +

+
+

+

+ {{ empresa.site }} +

+
-

- Sobre a Empresa -

-
- CNPJ: {{empresa.cnpj}} - Email: {{empresa.email}} -

Site: {{empresa.site}}

-
+

Nossos Estágios:

+
@@ -46,17 +79,7 @@ import Header from '../../components/Header.vue'; import Footer from '../../components/Footer.vue'; import AsideDashboard from '../../components/aluno/AsideDashboard.vue'; -import router from '../../router/index.js' -import { mixinEmpresa } from '../../util/authMixins.js'; - -import imgLapis from "../../assets/icons/lapis.png"; -import imgVerificar from "../../assets/icons/verificar.png"; -import imgCruz from "../../assets/icons/cruz.png"; - -import { getEmpresa } from '../../services/api/shared.js'; - -import Cookies from 'js-cookie'; -import { updateBanner, updateImage, updateSite } from '../../services/api/empresa.js'; +import { getEmpresa, getVagas } from '../../services/api/shared.js'; export default { name: 'PublicPerfilEmpresa', @@ -78,68 +101,47 @@ export default { site: '', siteSubmit: '', token: '', + vagas: [], }, - file: "", - fileSelected: false, - linkstatus: 0, mode: "view", - modeImage: "view", - modeBanner: "view", - imgLapis, - imgVerificar, - imgCruz, - extracurriculares: [], - showAddForm: false, - } + }; }, methods: { - async GetEmpresa(){ + async GetEmpresa() { try { const response = await getEmpresa(this.empresa.email); if (response.status >= 200 && response.status < 300) { this.empresa = response.data; - this.empresa.siteSubmit = response.data.site; + await this.loadVagasEmpresa(); } else { - console.error( - "Erro ao carregar dados da empresa", - response.message, - ); + console.error("Erro ao carregar dados da empresa", response.message); } } catch (error) { - console.error( - "Erro ao carregar dados da empresa", - error.message, - ); + console.error("Erro ao carregar dados da empresa", error.message); } }, - previewProfileImage(event) { - const file = event.target.files[0]; - if (!file) return; - - const reader = new FileReader(); - reader.onload = (e) => { - this.empresa.imagem = e.target.result; - }; - reader.readAsDataURL(file); - }, - previewBannerImage(event) { - const file = event.target.files[0]; - if (!file) return; - - const reader = new FileReader(); - reader.onload = (e) => { - this.empresa.banner = e.target.result; - }; - reader.readAsDataURL(file); + async loadVagasEmpresa() { + try { + const response = await getVagas(); + if (response.status >= 200 && response.status < 300) { + this.empresa.vagas = response.data.filter( + (vaga) => vaga.empresa.toLowerCase() === this.empresa.nome.toLowerCase() + ); + } else { + console.error("Erro ao carregar vagas da empresa."); + } + } catch (error) { + console.error("Erro ao carregar vagas da empresa.", error.message); + } }, }, async created() { this.empresa.email = this.$route.params.email; - await this.GetEmpresa(this.empresa.email); + await this.GetEmpresa(); } -} +}; \ No newline at end of file + diff --git a/client/src/views/shared/PerfilEmpresa.vue b/client/src/views/shared/PerfilEmpresa.vue index d146ed1..f68b48b 100644 --- a/client/src/views/shared/PerfilEmpresa.vue +++ b/client/src/views/shared/PerfilEmpresa.vue @@ -5,33 +5,64 @@
-
- Capa - Capa -
-
- - -
-
-

-
+
+ Capa + Capa +
+
+ + +
+
+

+
+
+
-
-

- Sobre a Empresa -

-
- CNPJ: {{empresa.cnpj}} - Email: {{empresa.email}} -

Site: {{empresa.site}}

- -
+
+

Nossos Estágios:

+
    +
  • +

    Nenhuma vaga cadastrada por esta empresa.

    +
  • +
  • + +
    +
    +

    {{ vaga.titulo }}

    + +
    + +

    +
    +
    + +

    +
    +
    + +

    +
    +
    + +

    +
    +
    +
    + +
    +
    +
    +
  • + +
@@ -50,7 +81,7 @@ import imgLapis from "../../assets/icons/lapis.png"; import imgVerificar from "../../assets/icons/verificar.png"; import imgCruz from "../../assets/icons/cruz.png"; -import { getEmpresa } from '../../services/api/shared.js'; +import { getEmpresa, getVagas } from '../../services/api/shared.js'; import Cookies from 'js-cookie'; import { updateBanner, updateImage, updateSite } from '../../services/api/empresa.js'; @@ -73,68 +104,47 @@ export default { site: '', siteSubmit: '', token: '', + vagas: [], }, - file: "", - fileSelected: false, - linkstatus: 0, mode: "view", - modeImage: "view", - modeBanner: "view", - imgLapis, - imgVerificar, - imgCruz, - extracurriculares: [], - showAddForm: false, - } + }; }, methods: { - async GetEmpresa(){ + async GetEmpresa() { try { const response = await getEmpresa(this.empresa.email); if (response.status >= 200 && response.status < 300) { this.empresa = response.data; - this.empresa.siteSubmit = response.data.site; + await this.loadVagasEmpresa(); } else { - console.error( - "Erro ao carregar dados da empresa", - response.message, - ); + console.error("Erro ao carregar dados da empresa", response.message); } } catch (error) { - console.error( - "Erro ao carregar dados da empresa", - error.message, - ); + console.error("Erro ao carregar dados da empresa", error.message); } }, - previewProfileImage(event) { - const file = event.target.files[0]; - if (!file) return; - - const reader = new FileReader(); - reader.onload = (e) => { - this.empresa.imagem = e.target.result; - }; - reader.readAsDataURL(file); - }, - previewBannerImage(event) { - const file = event.target.files[0]; - if (!file) return; - - const reader = new FileReader(); - reader.onload = (e) => { - this.empresa.banner = e.target.result; - }; - reader.readAsDataURL(file); + async loadVagasEmpresa() { + try { + const response = await getVagas(); + if (response.status >= 200 && response.status < 300) { + this.empresa.vagas = response.data.filter( + (vaga) => vaga.empresa.toLowerCase() === this.empresa.nome.toLowerCase() + ); + } else { + console.error("Erro ao carregar vagas da empresa."); + } + } catch (error) { + console.error("Erro ao carregar vagas da empresa.", error.message); + } }, }, async created() { this.empresa.email = this.$route.params.email; - await this.GetEmpresa(this.empresa.email); + await this.GetEmpresa(); } -} +}; \ No newline at end of file +