modified getOperationFormat

This commit is contained in:
Joel McKinnon 2020-02-28 08:37:20 -08:00
parent 1a409afb03
commit d2a45e46f1

View File

@ -44,7 +44,7 @@
{{ option.text }} {{ option.text }}
</option> </option>
</select> </select>
<span v-for="(item, inputIndex) in Array, inputCount" <span v-for="(item, inputIndex) in inputCount"
:key="inputIndex" :key="inputIndex"
> >
<input v-model="criterion.input[inputIndex]" <input v-model="criterion.input[inputIndex]"
@ -108,17 +108,19 @@ export default {
methods: { methods: {
getOperationFormat() { getOperationFormat() {
this.telemetryMetadata.valueMetadatas.forEach((value, index) => { this.telemetryMetadata.valueMetadatas.forEach((value, index) => {
let valueMetadata = this.telemetryMetadataOptions[index]; if (value.key === this.criterion.metadata) {
if (valueMetadata.formatString) { let valueMetadata = this.telemetryMetadataOptions[index];
this.operationFormat = 'number'; if (valueMetadata.enumerations !== undefined) {
} else if (valueMetadata.format) {
if (valueMetadata.format === 'utc') {
this.operationFormat = 'number';
} else if (valueMetadata.format === 'enum') {
this.operationFormat = 'enum'; this.operationFormat = 'enum';
} else if (valueMetadata.hints.hasOwnProperty('range')) {
this.operationFormat = 'number';
} else if (valueMetadata.hints.hasOwnProperty('domain')) {
this.operationFormat = 'number';
} else if (valueMetadata.key === 'name') {
this.operationFormat = 'string';
} else {
this.operationFormat = 'string';
} }
} else {
this.operationFormat = 'string';
} }
}); });
}, },