@@ -44,7 +44,7 @@ export default {
44
44
draggable,
45
45
VueCtkDateTimePicker
46
46
},
47
- props: {
47
+ props: {
48
48
field: Object ,
49
49
pass: {},
50
50
isItem: {
@@ -103,12 +103,12 @@ export default {
103
103
});
104
104
}
105
105
},
106
- computed: {
106
+ computed: {
107
107
fieldName () {
108
108
return this .field .name + (this .field .isArray ? ' []' : ' ' );
109
109
}
110
- },
111
- methods: {
110
+ },
111
+ methods: {
112
112
type () {
113
113
if (this .getFormat () === ' temporal_extent' ) {
114
114
return ' temporal_extent' ;
@@ -125,30 +125,43 @@ export default {
125
125
else if (this .field .type === ' boolean' ) {
126
126
return ' boolean' ;
127
127
}
128
+ else if (this .field .type === ' number' ) {
129
+ return ' number' ;
130
+ }
131
+ else if (this .field .type === ' integer' ) {
132
+ return ' integer' ;
133
+ }
128
134
else {
129
135
return ' string' ;
130
136
}
131
137
},
132
138
getValue () {
133
- if (this .type () === ' temporal_extent' ) {
139
+ var type = this .type ();
140
+ if (type === ' temporal_extent' ) {
134
141
return [this .value .start , this .value .end ];
135
142
}
136
- else if (this . type () === ' spatial_extent' ) {
137
- return {
143
+ else if (type === ' spatial_extent' ) {
144
+ return {
138
145
// Round to 6 decimals, the leading + removes the trailing zeros appended by toFixed.
139
146
west: + this .value .getWest ().toFixed (6 ),
140
147
south: + this .value .getSouth ().toFixed (6 ),
141
148
east: + this .value .getEast ().toFixed (6 ),
142
149
north: + this .value .getNorth ().toFixed (6 ),
143
150
};
144
151
}
145
- else if (this . type () === ' array' ) {
152
+ else if (type === ' array' ) {
146
153
var values = [];
147
154
for (var i in this .$refs .arrayFields ) {
148
155
values .push (this .$refs .arrayFields [i].getValue ());
149
156
}
150
157
return values;
151
158
}
159
+ else if (type === ' number' ) {
160
+ return Number .parseFloat (this .value );
161
+ }
162
+ else if (type === ' integer' ) {
163
+ return Number .parseInt (this .value );
164
+ }
152
165
else {
153
166
return this .value ;
154
167
}
@@ -167,17 +180,17 @@ export default {
167
180
this .value .splice (k, 1 );
168
181
return false ;
169
182
}
170
- }
183
+ }
171
184
};
172
185
</script >
173
186
174
187
<style scoped>
175
188
.arrayElement {
176
- transition : all 0.5s ;
189
+ transition : all 0.5s ;
177
190
}
178
191
179
192
.arrayElements-enter , .arrayElements-active {
180
- opacity : 0 ;
193
+ opacity : 0 ;
181
194
}
182
195
183
196
.mover {
0 commit comments