Skip to content

Commit

Permalink
[UPDATE] Front: padronizando telas e preparando estrutura do crud a p…
Browse files Browse the repository at this point in the history
…artir da listagem #15 #16 #17
  • Loading branch information
fernao committed May 31, 2019
1 parent 3fbbfeb commit e579a18
Show file tree
Hide file tree
Showing 7 changed files with 165 additions and 30 deletions.
4 changes: 1 addition & 3 deletions front/src/modules/area/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@ import store from '../../store';

sync(store);

export {
store,
};
export { store };
54 changes: 48 additions & 6 deletions front/src/modules/area/views/ListarAreas.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<template>
<v-container fluid>
<v-layout>
<v-flex xs10>
<v-flex
xs10
offset-xs1
>
<v-data-table
:headers="header"
:items="areas"
Expand All @@ -11,10 +14,38 @@
>
<td>{{ props.index + 1 }}</td>
<td>
<a
:href="getAreaUrl(props.item.id)">
<v-btn
flat
small
@click="visualizar(props.item.id)"
>
<v-icon class="pr-2">
grid_on
</v-icon>
{{ props.item.nome }}
</a>
</v-btn>
</td>
<td>
<v-btn
flat
small
@click="editar(props.item.id)"
>
<v-icon class="pr-2">
edit
</v-icon>
editar
</v-btn>
<v-btn
flat
small
@click="excluir(props.item.id)"
>
<v-icon class="pr-2">
clear
</v-icon>
excluir
</v-btn>
</td>
</template>
</v-data-table>
Expand All @@ -40,6 +71,10 @@ export default {
text: 'nome',
value: 'nome',
},
{
text: 'ações',
value: 'acoes',
},
],
areas: [],
};
Expand All @@ -61,8 +96,15 @@ export default {
...mapActions({
buscarAreas: 'area/buscarAreas',
}),
getAreaUrl(id) {
return `area/${id}`;
visualizar(id) {
const path = `/area/${id}`;
this.$router.push({ path });
},
editar(id) {
const path = `/area/${id}/edit`;
this.$router.push({ path });
},
excluir(id) {
},
},
};
Expand Down
54 changes: 48 additions & 6 deletions front/src/modules/especie/views/ListarEspecies.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<template>
<v-container fluid>
<v-layout>
<v-flex xs10>
<v-flex
xs10
offset-xs1
>
<v-data-table
:headers="header"
:items="especies"
Expand All @@ -11,13 +14,41 @@
>
<td>{{ props.index + 1 }}</td>
<td>
<a
:href="getEspecieUrl(props.item.id)">
<v-btn
flat
small
@click="visualizar(props.item.id)"
>
<v-icon class="pr-2">
local_florist
</v-icon>
{{ props.item.nome_cientifico }}
</a>
</v-btn>
</td>
<td>{{ props.item.familia }}</td>
<td>{{ props.item.nomes_populares }}</td>
<td>
<v-btn
flat
small
@click="editar(props.item.id)"
>
<v-icon class="pr-2">
edit
</v-icon>
editar
</v-btn>
<v-btn
flat
small
@click="excluir(props.item.id)"
>
<v-icon class="pr-2">
clear
</v-icon>
excluir
</v-btn>
</td>
</template>
</v-data-table>
</v-flex>
Expand Down Expand Up @@ -50,6 +81,10 @@ export default {
text: 'nomes populares',
value: 'nomes_populares',
},
{
text: 'ações',
value: 'acoes',
},
],
especies: [],
};
Expand All @@ -71,8 +106,15 @@ export default {
...mapActions({
buscarEspecies: 'especie/buscarEspecies',
}),
getEspecieUrl(id) {
return `especie/${id}`;
visualizar(id) {
const path = `/especie/${id}`;
this.$router.push({ path });
},
editar(id) {
const path = `/especie/${id}/editar`;
this.$router.push({ path });
},
excluir(id) {
},
},
};
Expand Down
5 changes: 4 additions & 1 deletion front/src/modules/especie/views/VisualizarEspecie.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<template>
<v-container fluid>
<v-layout>
<v-flex xs10>
<v-flex
xs10
offset-xs1
>
<v-card>
<v-card-title>
<div>
Expand Down
4 changes: 1 addition & 3 deletions front/src/modules/localidade/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@ import store from '../../store';

sync(store);

export {
store,
};
export { store };
54 changes: 48 additions & 6 deletions front/src/modules/localidade/views/ListarLocalidades.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<template>
<v-container fluid>
<v-layout>
<v-flex xs10>
<v-flex
xs10
offset-xs1
>
<v-data-table
:headers="header"
:items="localidades"
Expand All @@ -11,13 +14,41 @@
>
<td>{{ props.index + 1 }}</td>
<td>
<a
:href="getLocalidadeUrl(props.item.id)">
<v-btn
flat
small
@click="visualizar(props.item.id)"
>
<v-icon class="pr-2">
terrain
</v-icon>
{{ props.item.nome }}
</a>
</v-btn>
</td>
<td>{{ props.item.bioma }}</td>
<td>{{ props.item.clima }}</td>
<td>
<v-btn
flat
small
@click="editar(props.item.id)"
>
<v-icon class="pr-2">
edit
</v-icon>
editar
</v-btn>
<v-btn
flat
small
@click="excluir(props.item.id)"
>
<v-icon class="pr-2">
clear
</v-icon>
excluir
</v-btn>
</td>
</template>
</v-data-table>
</v-flex>
Expand Down Expand Up @@ -50,6 +81,10 @@ export default {
text: 'clima',
value: 'clima',
},
{
text: 'ações',
value: 'acoes',
},
],
localidades: [],
};
Expand All @@ -71,8 +106,15 @@ export default {
...mapActions({
buscarLocalidades: 'localidade/buscarLocalidades',
}),
getLocalidadeUrl(id) {
return `localidade/${id}`;
visualizar(id) {
const path = `/localidade/${id}`;
this.$router.push({ path });
},
editar(id) {
const path = `/localidade/${id}/edit`;
this.$router.push({ path });
},
excluir(id) {
},
},
};
Expand Down
20 changes: 15 additions & 5 deletions front/src/modules/localidade/views/VisualizarLocalidade.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<template>
<v-container fluid>
<v-layout>
<v-flex xs10>
<v-flex
xs10
offset-xs1
>
<v-card>
<v-card-title>
<div>
Expand Down Expand Up @@ -47,10 +50,16 @@
>
<td>{{ props.index + 1 }}</td>
<td>
<a
:href="getAreaUrl(props.item.id)">
<v-btn
flat
small
@click="getAreaUrl(props.item.id)"
>
<v-icon class="pr-2">
grid_on
</v-icon>
{{ props.item.nome }}
</a>
</v-btn>
</td>
<td>{{ props.item.dimensao }}</td>
<td>{{ props.item.microclima }}</td>
Expand Down Expand Up @@ -121,7 +130,8 @@ export default {
buscarAreasPorLocalidade: 'localidade/buscarAreasPorLocalidade',
}),
getAreaUrl(id) {
return `/area/${id}`;
const path = `/area/${id}`;
this.$router.push({ path });
},
},
computed: {
Expand Down

0 comments on commit e579a18

Please sign in to comment.