@nixweb/nixloc-ui 0.0.65 → 0.0.68

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.65",
3
+ "version": "0.0.68",
4
4
  "description": "Componentes UI",
5
5
  "author": "Fábio Ávila <fabio@nixweb.com.br>",
6
6
  "private": false,
@@ -43,10 +43,11 @@
43
43
  ></vue-loading>
44
44
  </button>
45
45
  </div>
46
- <br />
47
- <Alerta tipo="info" v-if="value">
48
- <span>{{ mensagem }}</span>
49
- </Alerta>
46
+ <div class="div-alerta">
47
+ <Alerta tipo="info" v-if="value">
48
+ <span>{{ mensagem }}</span>
49
+ </Alerta>
50
+ </div>
50
51
  </div>
51
52
  </div>
52
53
  </template>
@@ -80,7 +81,7 @@ export default {
80
81
  };
81
82
  },
82
83
  methods: {
83
- ...mapActions("generic", ["adicionarArquivoApi", "removerArquivoApi"]),
84
+ ...mapActions("generic", ["postFileApi", "deleteFileApi"]),
84
85
  carregar() {
85
86
  this.arquivo = this.$refs.arquivo.files[0];
86
87
  let params = {
@@ -91,10 +92,10 @@ export default {
91
92
  aceitos: this.aceitos,
92
93
  };
93
94
  this.carregandoAdicionar = true;
94
- this.adicionarArquivoApi(params).then((response) => {
95
+ this.postFileApi(params).then((response) => {
95
96
  if (response.sucesso) {
96
97
  if (this.aoCarregar) this.aoCarregar();
97
- this.$emit("input", response.dados);
98
+ this.$emit("input", response.conteudo);
98
99
  } else {
99
100
  this.limpar();
100
101
  }
@@ -109,7 +110,7 @@ export default {
109
110
  };
110
111
  this.carregandoRemover = true;
111
112
  let params = { url: this.urlRemover, obj: props };
112
- this.removerArquivoApi(params).then((response) => {
113
+ this.deleteFileApi(params).then((response) => {
113
114
  if (response.sucesso) {
114
115
  if (this.aoCarregar) this.aoCarregar();
115
116
  this.limpar();
@@ -170,6 +171,7 @@ export default {
170
171
  color: #fff;
171
172
  border-color: #f0134d;
172
173
  background: #f0134d;
174
+ margin-left: 5px;
173
175
  }
174
176
 
175
177
  .perigo:hover {
@@ -188,4 +190,10 @@ export default {
188
190
  top: 0;
189
191
  opacity: 0;
190
192
  }
193
+
194
+ .div-alerta{
195
+ margin-top:15px;
196
+ }
197
+
198
+
191
199
  </style>
@@ -78,7 +78,11 @@ export default {
78
78
  this.valor = this.value;
79
79
  },
80
80
  methods: {
81
- ...mapMutations("validation", ["insereValidacao", "removeValidacao"]),
81
+ ...mapMutations("validation", [
82
+ "insereValidacao",
83
+ "removeValidacao",
84
+ "insereFormSujo",
85
+ ]),
82
86
  ...mapMutations("generic", ["insereFiltro"]),
83
87
  valida() {
84
88
  this.notificacoes = [];
@@ -112,6 +116,7 @@ export default {
112
116
  valor() {
113
117
  this.valida();
114
118
  this.formSujo = true;
119
+ this.insereFormSujo(true);
115
120
  this.$emit("input", this.valor);
116
121
  },
117
122
  value() {
@@ -353,7 +353,12 @@ export default {
353
353
  },
354
354
  deleteFileApi: async function (context, params) {
355
355
  context.commit('limpaMetodoExecutadoApi');
356
- return axios.post(params.url, params.obj, {
356
+
357
+ let url = params.url;
358
+ let nome = params.obj.nome;
359
+ let container = params.obj.container;
360
+
361
+ return axios.delete(`${url}?nome=${nome}?container=${container}`, {
357
362
  headers: new Token().tokenHeaders(),
358
363
  })
359
364
  .then((response) => {
@@ -6,6 +6,22 @@ export default {
6
6
  itens: []
7
7
  },
8
8
  },
9
+ getters: {
10
+ temRegra: (state) => (nome) => {
11
+ var temRegra = state.usuarioLogado.usuario.regras.find(obj => {
12
+ return obj.nome === nome
13
+ })
14
+ if (temRegra == undefined) return false;
15
+ return true;
16
+ },
17
+ temModulo: (state) => (nome) => {
18
+ var temRegra = state.usuarioLogado.usuario.modulos.find(obj => {
19
+ return obj.nome === nome
20
+ })
21
+ if (temRegra == undefined) return false;
22
+ return true;
23
+ }
24
+ },
9
25
  mutations: {
10
26
  insereUsuarioLogado: (state, obj) => {
11
27
  state.usuarioLogado = obj;