From 8517efc939cf40c9bba597b33ce28b88b3412e9b Mon Sep 17 00:00:00 2001 From: VitorCarvalho67 Date: Sun, 24 Nov 2024 22:36:30 -0300 Subject: [PATCH 1/2] Update public header --- client/src/components/Header.vue | 2 +- client/src/scss/pages/shared/_vagas.scss | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/components/Header.vue b/client/src/components/Header.vue index b977179..7939b0c 100644 --- a/client/src/components/Header.vue +++ b/client/src/components/Header.vue @@ -16,7 +16,7 @@ -
  • Sobre Nós
  • +
  • Estágios
  • Cadastre-se Agora
  • + + + +
  • + + @@ -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 +