@nixweb/nixloc-ui 0.0.124 → 0.0.127

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.
Files changed (72) hide show
  1. package/docs/src/component/template/ViewTemplateReportPreview.drawio +210 -0
  2. package/package.json +3 -1
  3. package/src/component/forms/Button.vue +7 -6
  4. package/src/component/forms/CheckboxGroup.vue +7 -4
  5. package/src/component/forms/CheckboxSimple.vue +17 -2
  6. package/src/component/forms/DateTime.vue +15 -29
  7. package/src/component/forms/EditorHtml.vue +8 -5
  8. package/src/component/forms/FileUpload.vue +7 -11
  9. package/src/component/forms/ImageUpload.vue +222 -0
  10. package/src/component/forms/InputDecimal.vue +10 -9
  11. package/src/component/forms/InputNumber.vue +20 -15
  12. package/src/component/forms/InputPassword.vue +1 -1
  13. package/src/component/forms/InputText.vue +3 -3
  14. package/src/component/forms/Modal.vue +9 -4
  15. package/src/component/forms/Select.vue +12 -9
  16. package/src/component/forms/SelectStatic.vue +8 -1
  17. package/src/component/layout/Menu.vue +4 -3
  18. package/src/component/layout/Panel.vue +0 -2
  19. package/src/component/layout/{Scrollbar.vue → ScrollBar.vue} +4 -5
  20. package/src/component/layout/Tag.vue +3 -3
  21. package/src/component/layout/Wizard.vue +11 -13
  22. package/src/component/shared/BodyReport.vue +186 -0
  23. package/src/component/shared/Confirmation.vue +2 -2
  24. package/src/component/shared/DocumentEditor.vue +1 -1
  25. package/src/component/shared/ExportExcel.vue +1 -8
  26. package/src/component/shared/{HeaderPrint.vue → HeaderReport.vue} +3 -3
  27. package/src/component/shared/HorizontalFilter.vue +1 -1
  28. package/src/component/shared/Loading.vue +1 -1
  29. package/src/component/shared/Messages.vue +2 -4
  30. package/src/component/shared/Pagination.vue +4 -5
  31. package/src/component/shared/{LegendaParametro.vue → ParameterLegend.vue} +25 -29
  32. package/src/component/shared/ProgressBar.vue +2 -1
  33. package/src/component/shared/SaveCancel.vue +20 -4
  34. package/src/component/shared/Search.vue +16 -16
  35. package/src/component/shared/SelectOption.vue +137 -0
  36. package/src/component/shared/Table.vue +33 -22
  37. package/src/component/shared/TableButton.vue +3 -3
  38. package/src/component/shared/TableTotalRecords.vue +9 -10
  39. package/src/component/shared/Toast.vue +2 -2
  40. package/src/component/shared/VerticalFilter.vue +2 -50
  41. package/src/component/shared/query-builder/AddRule.vue +49 -55
  42. package/src/component/shared/query-builder/ConvertToOdata.js +39 -42
  43. package/src/component/shared/query-builder/DynamicComponent.vue +16 -15
  44. package/src/component/shared/query-builder/DynamicComponentList.vue +62 -0
  45. package/src/component/shared/query-builder/Fields.vue +32 -66
  46. package/src/component/shared/query-builder/QueryBuilder.vue +12 -12
  47. package/src/component/shared/query-builder/Rules.vue +2 -14
  48. package/src/component/shared/query-builder/SelectRule.vue +15 -15
  49. package/src/component/shared/query-builder/Tags.vue +24 -8
  50. package/src/component/template/{ListViewWithHandlerData.vue → ListViewWithDataHandler.vue} +30 -23
  51. package/src/component/template/{AddEditReport.vue → ReportCreateUpdate.vue} +31 -20
  52. package/src/component/template/ViewTemplateConfiguration.vue +6 -12
  53. package/src/component/template/ViewTemplateDocumentView.vue +21 -25
  54. package/src/component/template/ViewTemplateReportList.vue +39 -57
  55. package/src/component/template/ViewTemplateReportPreview.vue +238 -354
  56. package/src/component/template/ViewTemplateReportPreviewCOPIASEGURANCA.vue +497 -0
  57. package/src/component/template/ViewTemplateSelectOption.vue +60 -0
  58. package/src/component/template/ViewTemplateWithTable.vue +21 -14
  59. package/src/component/template/model/Report.js +2 -2
  60. package/src/component/value-objects/Address.js +11 -0
  61. package/src/component/value-objects/{Endereco.vue → Address.vue} +39 -40
  62. package/src/component/value-objects/{DadosContato.js → Contact.js} +2 -2
  63. package/src/component/value-objects/{DadosContato.vue → Contact.vue} +17 -17
  64. package/src/component/value-objects/Person.js +10 -0
  65. package/src/component/value-objects/{DadosPessoa.vue → Person.vue} +35 -35
  66. package/src/store/modules/generic.js +17 -11
  67. package/src/store/modules/report.js +124 -113
  68. package/src/store/modules/user.js +3 -0
  69. package/docs/src/component/template/ModeloRelatorioView.drawio +0 -160
  70. package/src/component/shared/query-builder/ListDynamicComponent.vue +0 -42
  71. package/src/component/value-objects/DadosPessoa.js +0 -10
  72. package/src/component/value-objects/Endereco.js +0 -11
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <b-row>
3
3
  <b-col xs="12" sm="12" md="12" lg="7" xl="6">
4
- <div class="margem">
4
+ <div class="margin">
5
5
  <div class="molded">
6
6
  <b-row>
7
7
  <b-col sm="9">
@@ -9,8 +9,8 @@
9
9
  type="text"
10
10
  name="search"
11
11
  placeholder="Pesquisar ..."
12
- @keyup="verificaLimpaPesquisa()"
13
- @keyup.enter.prevent="buscaPesquisa()"
12
+ @keyup="verifyCleanSearch()"
13
+ @keyup.enter.prevent="executeSearch()"
14
14
  v-model="search.content"
15
15
  /></b-col>
16
16
  <b-col sm="3">
@@ -18,12 +18,12 @@
18
18
  <SelectStatic
19
19
  fieldTarget="filter"
20
20
  :onlyQuery="true"
21
- :initialValue="{ content: 'Contém', id: 'contem' }"
21
+ :initialValue="{ content: 'Contém', id: 'contains' }"
22
22
  v-model="search.filter"
23
23
  :showBorder="false"
24
24
  :data="[
25
- { content: 'Contém', id: 'contem' },
26
- { content: 'Igual', id: 'igual' },
25
+ { content: 'Contém', id: 'contains' },
26
+ { content: 'Igual', id: 'equal' },
27
27
  ]"
28
28
  />
29
29
  </div>
@@ -35,20 +35,20 @@
35
35
  <b-col xs="4" sm="4" md="4" lg="4" xl="4">
36
36
  <div class="div-button">
37
37
  <Button
38
- key="search"
38
+ _key="btnSearch"
39
39
  type="info"
40
40
  title="Buscar"
41
41
  classIcon="fas fa-search"
42
42
  size="small"
43
- :clicked="buscaPesquisa"
43
+ :clicked="executeSearch"
44
44
  />
45
45
  <Button
46
- key="clean"
46
+ _key="btnClean"
47
47
  type="info"
48
48
  title="Limpar"
49
49
  classIcon="fas fa-broom"
50
50
  size="small"
51
- :clicked="limpaPesquisa"
51
+ :clicked="executeClean"
52
52
  />
53
53
  </div>
54
54
  </b-col>
@@ -63,7 +63,7 @@ import { mapMutations } from "vuex";
63
63
 
64
64
  export default {
65
65
  components: { Button, SelectStatic },
66
- name: "Pesquisa",
66
+ name: "Search",
67
67
  computed: {
68
68
  search: {
69
69
  get() {
@@ -80,15 +80,15 @@ export default {
80
80
  "executedSearch",
81
81
  "clearedSearch",
82
82
  ]),
83
- buscaPesquisa() {
83
+ executeSearch() {
84
84
  this.executedSearch();
85
85
  },
86
- limpaPesquisa() {
86
+ executeClean() {
87
87
  this.clearedSearch();
88
- let search = { content: "", filter: { content: "contem", id: "contem" } };
88
+ let search = { content: "", filter: { content: "Contém", id: "contains" } };
89
89
  this.updateSearch(search);
90
90
  },
91
- verificaLimpaPesquisa() {
91
+ verifyCleanSearch() {
92
92
  if (this.search.content.length == 0) this.clearedSearch();
93
93
  },
94
94
  },
@@ -106,7 +106,7 @@ export default {
106
106
  display: inline-block;
107
107
  }
108
108
 
109
- .margem {
109
+ .margin {
110
110
  padding-top: 28px;
111
111
  }
112
112
 
@@ -0,0 +1,137 @@
1
+ <template>
2
+ <div class="div-main text-center">
3
+ <div class="title" :style="'font-size:' + titleSize + 'px;'">
4
+ {{ title }}
5
+ </div>
6
+ <div class="alignment" v-for="option in options">
7
+ <div
8
+ class="option"
9
+ :style="'width:' + width + 'px; height:' + height + 'px'"
10
+ :class="{ selected: option.value == selected }"
11
+ @click="optionSelected(option.value)"
12
+ >
13
+ <div class="div-content text-center">
14
+ <span :style="'font-size:' + option.titleSize + 'px;'">
15
+ {{ option.title }}</span
16
+ >
17
+ <div class="icon" :style="'font-size:' + option.iconSize + 'px;'">
18
+ <i :class="option.icon"></i>
19
+ </div>
20
+ </div>
21
+ <div>
22
+ <i
23
+ v-b-tooltip.hover
24
+ :title="tip(option.tipId)"
25
+ class="fas fa-question-circle"
26
+ ></i>
27
+ </div>
28
+ </div>
29
+ </div>
30
+ <div class="div-btn">
31
+ <Button
32
+ _key="btnClickedNext"
33
+ type="info"
34
+ title="Avançar"
35
+ :disabled="selected == null"
36
+ :classIcon="buttonClassIcon"
37
+ :size="buttonSize"
38
+ :clicked="execute"
39
+ />
40
+ </div>
41
+ </div>
42
+ </template>
43
+ <script>
44
+ import Button from "@nixweb/nixloc-ui/src/component/forms/Button";
45
+
46
+ import { mapMutations, mapGetters } from "vuex";
47
+
48
+ export default {
49
+ name: "SelectOption",
50
+ components: {
51
+ Button,
52
+ },
53
+ props: {
54
+ title: String,
55
+ titleSize: Number,
56
+ buttonSize: String,
57
+ buttonClassIcon: String,
58
+ width: Number,
59
+ height: Number,
60
+ options: Array,
61
+ value: Number,
62
+ clickedNext: Function,
63
+ },
64
+ data() {
65
+ return {
66
+ selected: null,
67
+ };
68
+ },
69
+ methods: {
70
+ ...mapMutations("generic", ["removeLoading"]),
71
+ optionSelected(value) {
72
+ this.selected = value;
73
+ this.$emit("input", value);
74
+ },
75
+ execute() {
76
+ if (this.clickedNext) this.clickedNext();
77
+ this.removeLoading(["btnClickedNext"]);
78
+ },
79
+ },
80
+ computed: {
81
+ ...mapGetters("generic", ["tip"]),
82
+ },
83
+ };
84
+ </script>
85
+ <style scoped>
86
+ .div-main {
87
+ margin: auto;
88
+ padding: 10px;
89
+ }
90
+
91
+ .option {
92
+ cursor: pointer;
93
+ border: 1px solid #dbdfe9;
94
+ background-color: white;
95
+ border-radius: 8px;
96
+ padding-left: 10px;
97
+ padding-right: 7px;
98
+ margin-right: 10px;
99
+ margin-bottom: 10px;
100
+ font-size: 16px;
101
+ font-weight: normal;
102
+ }
103
+
104
+ .alignment {
105
+ display: inline-block;
106
+ }
107
+
108
+ .option:hover {
109
+ background-color: #fafafc;
110
+ }
111
+
112
+ .div-content {
113
+ padding: 10px;
114
+ }
115
+
116
+ .selected {
117
+ background-color: #fafafc;
118
+ }
119
+
120
+ .icon {
121
+ margin-top: 5px;
122
+ color: #577696;
123
+ }
124
+
125
+ .text {
126
+ font-size: 16px;
127
+ margin-top: 8px;
128
+ }
129
+
130
+ .title {
131
+ margin-bottom: 20px;
132
+ }
133
+
134
+ .div-btn {
135
+ margin-top: 20px;
136
+ }
137
+ </style>
@@ -19,7 +19,9 @@
19
19
  <tbody>
20
20
  <tr v-for="(row, index) in data" :key="index" :style="row.rowCss">
21
21
  <td class="td-checkbox" v-if="showChecks">
22
- <b-form-checkbox v-model="selected" :value="row.id" />
22
+ <div :class="{ 'center-vertical': row.photo != null }">
23
+ <b-form-checkbox v-model="selected" :value="row.id" />
24
+ </div>
23
25
  </td>
24
26
  <td v-for="(obj, ind) in header" :key="ind">
25
27
  <div
@@ -30,9 +32,20 @@
30
32
  </div>
31
33
  <div
32
34
  :class="convertClass(row[obj.fieldComparison], obj.classCssBody)"
33
- v-if="obj.type === 'class'"
35
+ v-if="obj.type === 'image'"
34
36
  >
35
- {{ row[obj.field] }}
37
+ <img
38
+ :style="'width:60;height:50px'"
39
+ :src="
40
+ 'https://espaco.blob.core.windows.net/nixloc-photo-product/' +
41
+ row[obj.field]
42
+ "
43
+ />
44
+ </div>
45
+ <div class="text-center center-vertical" v-if="obj.type === 'class'">
46
+ <div :class="convertClass(row[obj.fieldComparison], obj.classCssBody)">
47
+ {{ row[obj.field] }}
48
+ </div>
36
49
  </div>
37
50
  <div
38
51
  :class="convertClass(row[obj.fieldComparison], obj.classCssBody)"
@@ -67,24 +80,16 @@
67
80
  </div>
68
81
  <div
69
82
  :class="convertClass(row[obj.fieldComparison], obj.classCssBody)"
70
- v-if="obj.type === 'pdf'"
83
+ v-if="obj.type === 'button'"
71
84
  >
72
- <span
73
- @click="solicitarPdf(obj.pdf, row[obj.field])"
74
- class="icon"
75
- v-if="row[obj.field]"
76
- >
77
- <i :class="obj.icon"></i
78
- ></span>
79
- <span v-else>N/I</span>
85
+ <TableButton :obj="obj" :row="row" />
80
86
  </div>
81
87
  <div
88
+ class="link"
82
89
  :class="convertClass(row[obj.fieldComparison], obj.classCssBody)"
83
- v-if="obj.type === 'button'"
90
+ v-if="obj.type === 'link'"
91
+ @click="navegateTo(obj, row)"
84
92
  >
85
- <TableButton :obj="obj" :row="row" />
86
- </div>
87
- <div class="link" v-if="obj.type === 'link'" @click="navegateTo(obj, row)">
88
93
  <span> {{ row[obj.field] }}</span>
89
94
  </div>
90
95
  </td>
@@ -103,6 +108,7 @@
103
108
 
104
109
  <script>
105
110
  import TableButton from "@nixweb/nixloc-ui/src/component/shared/TableButton.vue";
111
+ import draggable from "@nixweb/nixloc-ui/vuedraggable";
106
112
 
107
113
  import { mapState, mapMutations, mapActions } from "vuex";
108
114
 
@@ -149,9 +155,7 @@ export default {
149
155
  classCssBody.forEach(function (value) {
150
156
  let classCss = value.classCss;
151
157
  let condition = value.fieldComparison == fieldComparison;
152
- let obj = {
153
- [classCss]: condition,
154
- };
158
+ let obj = { [classCss]: condition };
155
159
  ret.push(obj);
156
160
  });
157
161
  return ret;
@@ -163,11 +167,11 @@ export default {
163
167
  if (obj.routeName) {
164
168
  this.$router.push({
165
169
  name: obj.routeName,
166
- params: { id: row.id },
170
+ params: { id: row.id, type: row.type },
167
171
  });
168
172
  } else {
169
173
  this.addEvent({
170
- nome: obj.eventName,
174
+ name: obj.eventName,
171
175
  data: row,
172
176
  });
173
177
  }
@@ -180,7 +184,6 @@ export default {
180
184
  </script>
181
185
 
182
186
  <style scoped>
183
-
184
187
  table tbody tr td {
185
188
  max-width: 350px;
186
189
  }
@@ -240,4 +243,12 @@ tr:hover {
240
243
  .icon-link:hover {
241
244
  font-size: 12.5px;
242
245
  }
246
+
247
+ .center-vertical {
248
+ padding-top: 10px;
249
+ }
250
+
251
+ .badge-center {
252
+ margin: auto !important;
253
+ }
243
254
  </style>
@@ -10,7 +10,7 @@
10
10
  :eventName="obj.button.eventName"
11
11
  :eventData="row"
12
12
  />
13
- <BotaoDropdown
13
+ <Dropdown
14
14
  v-if="obj.qualBotao == 'botaodropdown'"
15
15
  :title="obj.button.title"
16
16
  :type="obj.button.type"
@@ -23,11 +23,11 @@
23
23
  </template>
24
24
 
25
25
  <script>
26
- import BotaoDropdown from "../forms/BotaoDropdown";
26
+ import Dropdown from "../forms/Dropdown";
27
27
  import Button from "../forms/Button";
28
28
  export default {
29
29
  name: "TableButton",
30
- components: { Button, BotaoDropdown },
30
+ components: { Button, Dropdown },
31
31
  props: {
32
32
  obj: Object,
33
33
  row: Object,
@@ -3,10 +3,10 @@
3
3
  <div class="col-sm-12 text-right">
4
4
  <span class="c-title">
5
5
  Total de
6
- <b-badge variant="warning">
7
- <span class="c-total">{{ totalRecords }}</span>
8
- </b-badge>
9
- <span class="records">registros</span>
6
+ <div class="badge">
7
+ <span class="total-records">{{ totalRecords }}</span>
8
+ </div>
9
+ <span class="records">registro(s)</span>
10
10
  </span>
11
11
  </div>
12
12
  </div>
@@ -33,13 +33,12 @@ export default {
33
33
  font-size: 14px;
34
34
  }
35
35
 
36
- .c-total {
37
- color: white;
38
- font-size: 14px;
36
+ .total-records {
37
+ font-size: 16px;
38
+ font-weight: 600;
39
39
  }
40
40
 
41
- .records{
41
+ .records {
42
42
  margin-left: 5px;
43
43
  }
44
-
45
- </style>
44
+ </style>
@@ -19,7 +19,7 @@ export default {
19
19
  methods: {
20
20
  notifica(value) {
21
21
  if (value.type == "postApi" || value.type == "putApi")
22
- this.$toasted.show("Salvo com success", {
22
+ this.$toasted.show("Salvo com sucesso", {
23
23
  type: "success",
24
24
  });
25
25
  if (value.type == "postApiError" || value.type == "putApiErro") {
@@ -30,7 +30,7 @@ export default {
30
30
  }
31
31
 
32
32
  if (value.type == "removerTodosApiSucesso")
33
- this.$toasted.show("Removido com success", {
33
+ this.$toasted.show("Removido com sucesso", {
34
34
  type: "success",
35
35
  });
36
36
  if (value.type == "removerTodosApiErro") {
@@ -4,7 +4,6 @@
4
4
  class="molded-button"
5
5
  :class="{ fechado: !showFilter, aberto: showFilter }"
6
6
  v-show="!showFilter"
7
- @click="mouseOver"
8
7
  >
9
8
  <i class="fas fa-arrow-circle-left"></i>
10
9
  </div>
@@ -19,67 +18,20 @@
19
18
  </div>
20
19
  </transition>
21
20
 
22
- <transition name="slide-fade">
23
- <div class="molded" v-show="showFilter">
24
- <div class="row">
25
- <div class="col-4 c-title-filter">
26
- <i class="fas fa-filter"></i>
27
- <span class="espaco-icon">FILTRO</span>
28
- </div>
29
- </div>
30
- <hr />
31
- <b-row v-if="mostrarSelecioneTotal">
32
- <b-col sm="6">
33
- <Select
34
- title="show"
35
- field="show"
36
- :required="false"
37
- url="/api/v1/util/total-por-pagina"
38
- v-model="totalPerPage"
39
- />
40
- </b-col>
41
- </b-row>
42
- <slot></slot>
43
- </div>
44
- </transition>
21
+ <transition name="slide-fade"> </transition>
45
22
  </div>
46
23
  </template>
47
24
 
48
25
  <script>
49
- import Select from "../forms/Select";
50
-
51
26
  import { mapMutations } from "vuex";
52
27
 
53
28
  export default {
54
- props: {
55
- mostrarSelecioneTotal: {
56
- type: Boolean,
57
- default: true,
58
- },
59
- },
60
- components: { Select },
29
+ components: {},
61
30
  data() {
62
31
  return {
63
32
  showFilter: false,
64
33
  };
65
34
  },
66
- computed: {
67
- totalPerPage: {
68
- get() {
69
- return this.$store.state.generic.totalPerPage;
70
- },
71
- set(value) {
72
- if (!value.content) value.content = 10;
73
- this.atualizaTotalPorPagina(value);
74
- },
75
- },
76
- },
77
- methods: {
78
- ...mapMutations("generic", ["atualizaTotalPorPagina"]),
79
- mouseOver: function () {
80
- this.showFilter = !this.showFilter;
81
- },
82
- },
83
35
  };
84
36
  </script>
85
37
 
@@ -1,31 +1,33 @@
1
1
  <template>
2
- <div class="vqb-group card">
3
- <div class="vqb-group-body card-body">
4
- <div class="rule-actions form-inline">
5
- <div class="div-custom">
6
- <b-row>
7
- <b-col sm="6">
8
- <SelectRule :options="rules" class="select" v-model="selectedRule" />
9
- </b-col>
10
- <b-col sm="3">
11
- <RadioGroup
12
- :options="[
13
- { text: 'e', value: 'and' },
14
- { text: 'ou', value: 'or' },
15
- ]"
16
- v-model="andOr"
17
- />
18
- </b-col>
19
- <b-col sm="3">
20
- <button type="button" class="btn btn-secondary" @click="Add">
21
- + Adicionar
22
- </button>
23
- </b-col>
24
- </b-row>
2
+ <div>
3
+ <div class="vqb-group card">
4
+ <div class="vqb-group-body card-body">
5
+ <div class="rule-actions form-inline">
6
+ <div class="div-custom">
7
+ <b-row>
8
+ <b-col sm="6">
9
+ <SelectRule :options="rules" class="select" v-model="selectedRule" />
10
+ </b-col>
11
+ <b-col sm="3">
12
+ <RadioGroup
13
+ :options="[
14
+ { text: 'e', value: 'and' },
15
+ { text: 'ou', value: 'or' },
16
+ ]"
17
+ v-model="andOr"
18
+ />
19
+ </b-col>
20
+ <b-col sm="3">
21
+ <button type="button" class="btn btn-secondary" @click="add">
22
+ + Adicionar
23
+ </button>
24
+ </b-col>
25
+ </b-row>
26
+ </div>
25
27
  </div>
26
28
  </div>
27
- <ListDynamicComponent />
28
29
  </div>
30
+ <DynamicComponentList />
29
31
  </div>
30
32
  </template>
31
33
 
@@ -33,9 +35,7 @@
33
35
  import SelectRule from "./SelectRule.vue";
34
36
  import DynamicComponent from "./DynamicComponent.vue";
35
37
  import RadioGroup from "@nixweb/nixloc-ui/src/component/forms/RadioGroup.vue";
36
- import ListDynamicComponent from "@nixweb/nixloc-ui/src/component/shared/construtor-query/ListDynamicComponent.vue";
37
-
38
- import deepClone from "./utilities.js";
38
+ import DynamicComponentList from "@nixweb/nixloc-ui/src/component/shared/query-builder/DynamicComponentList.vue";
39
39
 
40
40
  import { mapGetters, mapMutations } from "vuex";
41
41
 
@@ -45,21 +45,16 @@ export default {
45
45
  SelectRule,
46
46
  DynamicComponent,
47
47
  RadioGroup,
48
- ListDynamicComponent,
48
+ DynamicComponentList,
49
49
  },
50
50
  props: {
51
- query: Object,
52
51
  rules: Array,
53
- index: Number,
54
- maximaProfunidade: Number,
55
- profundidade: Number,
56
- titulos: Object,
57
52
  },
58
53
  data() {
59
54
  return {
60
55
  selectedRule: this.rules[0],
61
56
  andOr: "or",
62
- duplicidade: [],
57
+ duplicate: [],
63
58
  };
64
59
  },
65
60
  computed: {
@@ -73,26 +68,25 @@ export default {
73
68
  this.addRule();
74
69
  },
75
70
  addRule() {
76
- let consulta_atualizada = deepClone(this.query);
77
- let obj = this.montaFiltro();
71
+ let obj = this.mountObject();
78
72
 
79
- if (!this.jaExiste(obj.nome)) {
73
+ if (!this.verifyIfExist(obj.name)) {
80
74
  this.addSelectedRules(obj);
81
- if (obj.naoPermitirDuplicidade) this.duplicidade.push(obj);
75
+ if (obj.notDuplicate) this.duplicate.push(obj);
82
76
  } else {
83
- var erro = {
77
+ var error = {
84
78
  property: "ERRO QUERY BUILDER",
85
79
  message: `Não é possível adicionar o filter ${obj.title} 2 vezes!`,
86
80
  };
87
- this.addNotifications([erro]);
81
+ this.addNotifications([error]);
88
82
  }
89
83
  },
90
- montaFiltro() {
84
+ mountObject() {
91
85
  let obj = {
92
- id: this.geraId(),
93
- nome: this.selectedRule.nome,
86
+ id: this.generateId(),
87
+ name: this.selectedRule.name,
94
88
  title: this.selectedRule.title,
95
- fieldType: this.selectedRule.fieldType,
89
+ typeField: this.selectedRule.typeField,
96
90
  type: this.selectedRule.type,
97
91
  options: this.selectedRule.options,
98
92
  props: this.selectedRule.props,
@@ -102,34 +96,34 @@ export default {
102
96
  operator: null,
103
97
  andOr: this.selectedRule.andOr,
104
98
  isRequired: this.selectedRule.isRequired,
105
- naoPermitirDuplicidade: this.selectedRule.naoPermitirDuplicidade,
106
- valor: null,
99
+ notDuplicate: this.selectedRule.notDuplicate,
100
+ value: null,
107
101
  };
108
102
  return obj;
109
103
  },
110
- geraId() {
104
+ generateId() {
111
105
  return Math.random()
112
106
  .toString(36)
113
107
  .replace(/[^a-z]+/g, "")
114
108
  .substr(0, 5);
115
109
  },
116
- jaExiste(key) {
117
- var existe = this.duplicidade.find((item) => {
118
- return item.nome === key;
110
+ verifyIfExist(name) {
111
+ var hasRule = this.duplicate.find((rule) => {
112
+ return rule.name === name;
119
113
  });
120
- if (existe) return true;
114
+ if (hasRule) return true;
121
115
  return false;
122
116
  },
123
117
  },
124
118
  watch: {
125
119
  event: {
126
120
  handler(event) {
127
- // Se a tag ou a rule que está selecionada foi removida, é necessário remove tambem do array "duplicidade" para liberar e adicionar novamente.
128
- if (event.nome == "tagRemovida" || event.nome == "selectedRuleRemovida") {
129
- var duplicidade = this.duplicidade.filter((item) => {
121
+ // se a tag ou a rule que está selecionada foi removida, é necessário remove tambem do array "duplicate" para liberar e adicionar novamente.
122
+ if (event.name == "tagRemoved" || event.name == "selectedRuleRemoved") {
123
+ var duplicate = this.duplicate.filter((item) => {
130
124
  return item.id != event.data.id;
131
125
  });
132
- this.duplicidade = duplicidade;
126
+ this.duplicate = duplicate;
133
127
  }
134
128
  },
135
129
  deep: true,