|
@@ -2,27 +2,31 @@
|
2
|
2
|
<div class="form-group row">
|
3
|
3
|
<div class="col-md-4 mb-2" v-for="(currentField, i) in fields" :key="i">
|
4
|
4
|
<label>{{ currentField.name }}</label>
|
5
|
|
- <input
|
6
|
|
- v-if="currentField.type === 'number'"
|
7
|
|
- class="form-control form-control-lg form-control-a"
|
8
|
|
- type="number"
|
9
|
|
- name="currentField.name"
|
10
|
|
- id="currentField.id"
|
11
|
|
- v-model="setFields[i]"
|
12
|
|
- @change="UpdateSetFields(currentField, i)"
|
13
|
|
- />
|
14
|
|
- <input
|
15
|
|
- v-if="currentField.type === 'text'"
|
16
|
|
- class="form-control form-control-lg form-control-a"
|
17
|
|
- type="text"
|
18
|
|
- name="currentField.name"
|
19
|
|
- id="currentField.id"
|
20
|
|
- v-model="setFields[i]"
|
21
|
|
- @change="UpdateSetFields(currentField, i)"
|
22
|
|
- />
|
23
|
|
- <div v-if="currentField.type === 'yesno'">
|
|
5
|
+ <div class="input-group-prepend">
|
|
6
|
+ <span class="input-group-text" style="color: #60CBEB">
|
|
7
|
+ <b>{{ GetFirstLetter(currentField.name) }}</b>
|
|
8
|
+ </span>
|
|
9
|
+ <input
|
|
10
|
+ v-if="currentField.type === 'number'"
|
|
11
|
+ class="form-control"
|
|
12
|
+ type="number"
|
|
13
|
+ name="currentField.name"
|
|
14
|
+ id="currentField.id"
|
|
15
|
+ v-model="setFields[i]"
|
|
16
|
+ @change="UpdateSetFields(currentField, i)"
|
|
17
|
+ />
|
|
18
|
+ <input
|
|
19
|
+ v-if="currentField.type === 'text'"
|
|
20
|
+ class="form-control"
|
|
21
|
+ type="text"
|
|
22
|
+ name="currentField.name"
|
|
23
|
+ id="currentField.id"
|
|
24
|
+ v-model="setFields[i]"
|
|
25
|
+ @change="UpdateSetFields(currentField, i)"
|
|
26
|
+ />
|
24
|
27
|
<select
|
25
|
|
- class="form-control form-control-lg form-control-a"
|
|
28
|
+ v-if="currentField.type === 'yesno'"
|
|
29
|
+ class="form-control"
|
26
|
30
|
id="currentField.id"
|
27
|
31
|
v-model="setFields[i]"
|
28
|
32
|
@change="UpdateSetFields(currentField, i)"
|
|
@@ -54,6 +58,19 @@ export default {
|
54
|
58
|
};
|
55
|
59
|
this.$emit('UpdateUserDefinedFields', item);
|
56
|
60
|
},
|
|
61
|
+ GetFirstLetter(value) {
|
|
62
|
+ if (value) {
|
|
63
|
+ return value.slice(0, 1);
|
|
64
|
+ }
|
|
65
|
+ return '';
|
|
66
|
+ },
|
57
|
67
|
},
|
|
68
|
+ // Testing editing
|
|
69
|
+ // created() {
|
|
70
|
+ // this.setFields = [];
|
|
71
|
+ // for (let i = 0; i < this.fields.length; i++) {
|
|
72
|
+ // this.setFields[i] = this.fields[i].value;
|
|
73
|
+ // }
|
|
74
|
+ // },
|
58
|
75
|
};
|
59
|
76
|
</script>
|