@nixweb/nixloc-ui 0.0.58 → 0.0.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nixweb/nixloc-ui",
3
- "version": "0.0.58",
3
+ "version": "0.0.61",
4
4
  "description": "Componentes UI",
5
5
  "author": "Fábio Ávila <fabio@nixweb.com.br>",
6
6
  "private": false,
@@ -7,8 +7,6 @@
7
7
  :class="{
8
8
  topo: posicao == 'topo',
9
9
  rodape: posicao == 'rodape',
10
- esconde: menu.escondeMostra,
11
- mostra: !menu.escondeMostra,
12
10
  }"
13
11
  >
14
12
  <div class="tamanho">
@@ -35,7 +33,6 @@ export default {
35
33
  },
36
34
  computed: {
37
35
  ...mapGetters("generic", ["carregando"]),
38
- ...mapState("generic", ["menu"]),
39
36
  },
40
37
  };
41
38
  </script>
@@ -48,6 +45,7 @@ export default {
48
45
  overflow: hidden;
49
46
  z-index: 20;
50
47
  padding: 18px;
48
+ margin-left: 220px;
51
49
  }
52
50
 
53
51
  .tamanho {
@@ -68,11 +66,4 @@ export default {
68
66
  border-top: 1px solid #e1e1e2;
69
67
  }
70
68
 
71
- .esconde {
72
- padding-left: 60px;
73
- }
74
-
75
- .mostra {
76
- padding-left: 230px;
77
- }
78
69
  </style>
@@ -7,8 +7,10 @@
7
7
  @click.prevent="navegarPara('dashboard')"
8
8
  :class="sessaoDestaque('home')"
9
9
  >
10
- <i class="fa fa-home menu__icon" aria-hidden="true"></i>
11
- Dashboard
10
+ <div class="div-icone lado-a-lado" :style="'background-color:' + corBase">
11
+ <i class="fa fa-home icone" aria-hidden="true"></i>
12
+ </div>
13
+ <div class="lado-a-lado titulo">Dashboard</div>
12
14
  </a>
13
15
  </li>
14
16
 
@@ -18,9 +20,13 @@
18
20
  @click.prevent="abrirSubMenu(item.modulo)"
19
21
  :class="sessaoDestaque(item.modulo)"
20
22
  >
21
- <i :class="item.icone" class="menu__icon" aria-hidden="true"></i>
22
- {{ item.modulo }}
23
- <i class="fa fa-chevron-right menu__arrow-icon" aria-hidden="true"></i>
23
+ <div class="div-icone lado-a-lado" :style="'background-color:' + corBase">
24
+ <i :class="item.icone" class="icone" aria-hidden="true"></i>
25
+ </div>
26
+ <div class="lado-a-lado titulo">{{ item.modulo }}</div>
27
+ <div class="lado-a-lado seta menu__arrow-icon">
28
+ <i class="fa fa-chevron-right" aria-hidden="true"></i>
29
+ </div>
24
30
  </a>
25
31
  </li>
26
32
  </ul>
@@ -62,6 +68,12 @@ import { mapState } from "vuex";
62
68
 
63
69
  export default {
64
70
  name: "Menu",
71
+ props: {
72
+ corBase: {
73
+ type: String,
74
+ default: "#4680A5",
75
+ },
76
+ },
65
77
  data() {
66
78
  return {
67
79
  modulo: "",
@@ -112,7 +124,29 @@ export default {
112
124
  },
113
125
  },
114
126
  computed: {
115
- ...mapState("generic", ["menu"]),
127
+ ...mapState("usuario", ["menu"]),
116
128
  },
117
129
  };
118
130
  </script>
131
+
132
+ <style scoped>
133
+ .div-icone {
134
+ width: 30px;
135
+ height: 30px;
136
+ padding-left: 6px;
137
+ padding-top: 3px;
138
+ border-radius: 8px;
139
+ }
140
+
141
+ .icone {
142
+ color: white;
143
+ font-size: 16px;
144
+ }
145
+
146
+ .titulo {
147
+ margin-left: 15px;
148
+ }
149
+
150
+ .seta {
151
+ }
152
+ </style>
@@ -67,7 +67,7 @@ export default {
67
67
  watch: {
68
68
  value: {
69
69
  handler() {
70
- this.dadosPessoa = this.value;
70
+ this.dadosContato = this.value;
71
71
  },
72
72
  deep: true,
73
73
  },
@@ -6,9 +6,6 @@ import Token from "@nixweb/nixloc-ui/src/config/token";
6
6
  export default {
7
7
  namespaced: true,
8
8
  state: {
9
- menu: {
10
- itens: []
11
- },
12
9
  modal: {
13
10
  nome: undefined,
14
11
  abrir: false
@@ -69,14 +66,6 @@ export default {
69
66
  },
70
67
  },
71
68
  mutations: {
72
- insereItemMenu: (state, itens) => {
73
- itens.forEach(function (obj) {
74
- state.menu.itens.push(obj);
75
- });
76
- },
77
- removeItensMenu: (state) => {
78
- state.menu.itens = [];
79
- },
80
69
  abrirModal: (state, nome) => {
81
70
  state.modal.nome = nome;
82
71
  state.modal.abrir = true;
@@ -187,7 +176,12 @@ export default {
187
176
  return response.data;
188
177
  }
189
178
  }, (err) => {
190
- context.commit('insereNotificacaoErroApi');
179
+ if (err.response)
180
+ if (err.response.status === 403)
181
+ context.commit('insereNotificacao', [{ mensagem: "Usuário não autorizado!" }])
182
+
183
+ if (!err.response)
184
+ context.commit('insereNotificacaoErroApi');
191
185
  return false;
192
186
  })
193
187
  },
@@ -212,7 +206,13 @@ export default {
212
206
  return response.data;
213
207
  }
214
208
  }, (err) => {
215
- context.commit('insereNotificacaoErroApi');
209
+ if (err.response)
210
+ if (err.response.status === 403)
211
+ context.commit('insereNotificacao', [{ mensagem: "Usuário não autorizado!" }])
212
+
213
+ if (!err.response)
214
+ context.commit('insereNotificacaoErroApi');
215
+
216
216
  return false;
217
217
  })
218
218
  },
@@ -261,7 +261,12 @@ export default {
261
261
  }
262
262
 
263
263
  }, (err) => {
264
- context.commit('insereNotificacaoErroApi');
264
+ if (err.response)
265
+ if (err.response.status === 403)
266
+ context.commit('insereNotificacao', [{ mensagem: "Usuário não autorizado!" }])
267
+
268
+ if (!err.response)
269
+ context.commit('insereNotificacaoErroApi');
265
270
  return false;
266
271
  })
267
272
  },
@@ -286,7 +291,12 @@ export default {
286
291
  }
287
292
 
288
293
  }, (err) => {
289
- context.commit('insereNotificacaoErroApi');
294
+ if (err.response)
295
+ if (err.response.status === 403)
296
+ context.commit('insereNotificacao', [{ mensagem: "Usuário não autorizado!" }])
297
+
298
+ if (!err.response)
299
+ context.commit('insereNotificacaoErroApi');
290
300
  return false;
291
301
  })
292
302
  },
@@ -331,7 +341,12 @@ export default {
331
341
  return response.data;
332
342
  }
333
343
  }, (err) => {
334
- context.commit('insereNotificacaoErroApi');
344
+ if (err.response)
345
+ if (err.response.status === 403)
346
+ context.commit('insereNotificacao', [{ mensagem: "Usuário não autorizado!" }])
347
+
348
+ if (!err.response)
349
+ context.commit('insereNotificacaoErroApi');
335
350
  return false;
336
351
  })
337
352
  },
@@ -351,7 +366,12 @@ export default {
351
366
  return response.data;
352
367
  }
353
368
  }, (err) => {
354
- context.commit('insereNotificacaoErroApi');
369
+ if (err.response)
370
+ if (err.response.status === 403)
371
+ context.commit('insereNotificacao', [{ mensagem: "Usuário não autorizado!" }])
372
+
373
+ if (!err.response)
374
+ context.commit('insereNotificacaoErroApi');
355
375
  return false;
356
376
  })
357
377
  },
@@ -0,0 +1,22 @@
1
+ export default {
2
+ namespaced: true,
3
+ state: {
4
+ usuarioLogado: {},
5
+ menu: {
6
+ itens: []
7
+ },
8
+ },
9
+ mutations: {
10
+ insereUsuarioLogado: (state, obj) => {
11
+ state.usuarioLogado = obj;
12
+ },
13
+ insereItemMenu: (state, itens) => {
14
+ itens.forEach(function (obj) {
15
+ state.menu.itens.push(obj);
16
+ });
17
+ },
18
+ removeItensMenu: (state) => {
19
+ state.menu.itens = [];
20
+ },
21
+ },
22
+ }
@@ -1,6 +1,7 @@
1
1
  import Vue from 'vue';
2
2
  import Vuex from 'vuex';
3
3
 
4
+ import usuario from './modulos/usuario'
4
5
  import generic from './modulos/generic'
5
6
  import validation from './modulos/validation'
6
7
 
@@ -8,6 +9,6 @@ Vue.use(Vuex)
8
9
 
9
10
  export default new Vuex.Store({
10
11
  modules: {
11
- generic, validation
12
+ generic, validation, usuario
12
13
  }
13
14
  })