@nixweb/nixloc-ui 0.0.298 → 0.0.299

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.298",
3
+ "version": "0.0.299",
4
4
  "description": "Componentes UI",
5
5
  "author": "Fábio Ávila <fabio@nixweb.com.br>",
6
6
  "private": false,
@@ -43,28 +43,37 @@
43
43
  :class="convertClass(row[obj.fieldComparison], obj.classCssBody)">
44
44
  <TableButton v-if="obj.ifFieldEqual == row[obj.field]" :obj="obj" :row="row" />
45
45
  </div>
46
- <div v-if="obj.type === 'link'" class="link" :style="obj.styleBody"
46
+ <div v-if="obj.type === 'link'" :style="obj.styleBody"
47
47
  :class="convertClass(row[obj.fieldComparison], obj.classCssBody)" @click="navegateTo(obj, row)">
48
- <span> {{ row[obj.field] }}</span>
49
- <div class="field-second">{{ row[obj.fieldSecond] }}</div>
48
+ <div class="div-progress" v-if="idSelected == row.id">
49
+ <ProgressBar bgColor="orange" bColor="#CCCCCC" size="4" :value="loadingProgress" :max="100" />
50
+ </div>
51
+ <div class="link" v-else>
52
+ <span> {{ row[obj.field] }}</span>
53
+ <div class="field-second">{{ row[obj.fieldSecond] }}</div>
54
+ </div>
50
55
  </div>
51
56
  </div>
52
57
  </template>
53
58
  <script>
54
59
  import TableButton from "@nixweb/nixloc-ui/src/component/shared/TableButton.vue";
55
60
  import DisplayPeriodRent from "@nixweb/nixloc-ui/src/component/rental/DisplayPeriodRent";
61
+ import ProgressBar from "@nixweb/nixloc-ui/src/component/shared/ProgressBar";
56
62
 
57
63
  import { mapMutations } from "vuex";
58
64
 
59
65
  export default {
60
66
  name: "TableItem",
61
- components: { TableButton, DisplayPeriodRent },
67
+ components: { TableButton, DisplayPeriodRent, ProgressBar },
62
68
  props: {
63
69
  obj: Object,
64
70
  row: Object,
65
71
  },
66
72
  data() {
67
- return {};
73
+ return {
74
+ idSelected: "",
75
+ loadingProgress: 0,
76
+ };
68
77
  },
69
78
  computed: {
70
79
  urlImage() {
@@ -94,17 +103,43 @@ export default {
94
103
  return eval(conditionVisibility);
95
104
  },
96
105
  navegateTo(obj, row) {
97
- if (obj.routeName) {
98
- this.$router.push({
99
- name: obj.routeName,
100
- params: { id: row.id, type: row.type },
101
- });
102
- } else {
103
- this.addEvent({
104
- name: obj.eventName,
105
- data: row,
106
- });
107
- }
106
+ this.idSelected = row.id;
107
+ this.startLoading(obj, row);
108
+ },
109
+ startLoading(obj, row) {
110
+ let self = this;
111
+ const interval = setInterval(() => {
112
+ if (self.loadingProgress < 100) {
113
+ self.loadingProgress += 10;
114
+ } else {
115
+ clearInterval(interval);
116
+ }
117
+ }, 50);
118
+ }
119
+ },
120
+ watch: {
121
+ loadingProgress: {
122
+ handler(loadingProgress) {
123
+ if (loadingProgress == 100) {
124
+ if (this.obj.routeName) {
125
+ this.$router.push({
126
+ name: this.obj.routeName,
127
+ params: { id: this.row.id, type: this.row.type },
128
+ });
129
+ } else {
130
+ this.addEvent({
131
+ name: this.obj.eventName,
132
+ data: this.row,
133
+ });
134
+
135
+ let self = this;
136
+ setTimeout(function () {
137
+ self.idSelected = "";
138
+ }, 200);
139
+ }
140
+ }
141
+ },
142
+ deep: true,
108
143
  },
109
144
  },
110
145
  };
@@ -172,5 +207,8 @@ export default {
172
207
  cursor: pointer;
173
208
  }
174
209
 
175
-
210
+ .div-progress {
211
+ margin-top: 11px;
212
+ width: 200px;
213
+ }
176
214
  </style>
@@ -3,13 +3,8 @@
3
3
  <Loading :center="false" v-if="loading" />
4
4
  <div v-else>
5
5
  <ScrollBar :minHeight="200" :maxHeight="300">
6
- <Timeline
7
- dateLocale="pt-BR"
8
- order="desc"
9
- :uniqueTimeline="true"
10
- :timeline-items="timelineItems"
11
- message-when-no-items="Nenhum registro encontrado!"
12
- />
6
+ <Timeline dateLocale="pt-BR" order="desc" :uniqueTimeline="true" :timeline-items="timelineItems"
7
+ message-when-no-items="Nenhum registro encontrado!" />
13
8
  </ScrollBar>
14
9
  </div>
15
10
  </div>
@@ -53,7 +53,7 @@
53
53
  </div>
54
54
  </div>
55
55
  </div>
56
- <div v-if="attachments.length == 0">
56
+ <div class="title" v-if="attachments.length == 0">
57
57
  Nenhum arquivo adicionado!
58
58
  </div>
59
59
  </b-col>
@@ -380,7 +380,7 @@ export default {
380
380
  color: green;
381
381
  }
382
382
 
383
- .title {
383
+ .title-file {
384
384
  font-size: 18px;
385
385
  margin-bottom: 20px;
386
386
  }