mirror of
https://github.com/nasa/openmct.git
synced 2025-05-31 14:40:48 +00:00
refactored setOutput
This commit is contained in:
parent
2415d785cc
commit
6e5e8f0ce8
@ -58,13 +58,13 @@
|
|||||||
>
|
>
|
||||||
<option value="">- Select Output -</option>
|
<option value="">- Select Output -</option>
|
||||||
<option v-for="option in outputOptions"
|
<option v-for="option in outputOptions"
|
||||||
:key="option.key"
|
:key="option"
|
||||||
:value="option.key"
|
:value="option"
|
||||||
>
|
>
|
||||||
{{ option.text }}
|
{{ option.charAt(0).toUpperCase() + option.slice(1) }}
|
||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
<input v-if="selectedOutputKey === outputOptions[2].key"
|
<input v-if="selectedOutputKey === outputOptions[2]"
|
||||||
v-model="domainObject.configuration.output"
|
v-model="domainObject.configuration.output"
|
||||||
class="t-condition-name-input"
|
class="t-condition-name-input"
|
||||||
type="text"
|
type="text"
|
||||||
@ -179,20 +179,7 @@ export default {
|
|||||||
trigger: 'any',
|
trigger: 'any',
|
||||||
selectedOutputKey: '',
|
selectedOutputKey: '',
|
||||||
stringOutputField: false,
|
stringOutputField: false,
|
||||||
outputOptions: [
|
outputOptions: ['false', 'true', 'string']
|
||||||
{
|
|
||||||
key: 'false',
|
|
||||||
text: 'False'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'true',
|
|
||||||
text: 'True'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'string',
|
|
||||||
text: 'String'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
destroyed() {
|
destroyed() {
|
||||||
@ -262,13 +249,11 @@ export default {
|
|||||||
},
|
},
|
||||||
setOutput() {
|
setOutput() {
|
||||||
let conditionOutput = this.domainObject.configuration.output;
|
let conditionOutput = this.domainObject.configuration.output;
|
||||||
|
if (conditionOutput) {
|
||||||
if (conditionOutput !== 'false' && conditionOutput !== 'true') {
|
if (conditionOutput !== 'false' && conditionOutput !== 'true') {
|
||||||
this.selectedOutputKey = this.outputOptions[2].key;
|
this.selectedOutputKey = 'string';
|
||||||
} else {
|
} else {
|
||||||
if (conditionOutput === 'true') {
|
this.selectedOutputKey = conditionOutput;
|
||||||
this.selectedOutputKey = this.outputOptions[1].key;
|
|
||||||
} else {
|
|
||||||
this.selectedOutputKey = this.outputOptions[0].key;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -276,14 +261,14 @@ export default {
|
|||||||
this.openmct.objects.mutate(this.domainObject, 'configuration', this.domainObject.configuration);
|
this.openmct.objects.mutate(this.domainObject, 'configuration', this.domainObject.configuration);
|
||||||
},
|
},
|
||||||
checkInputValue() {
|
checkInputValue() {
|
||||||
if (this.selectedOutputOption === this.outputOptions[2].key) {
|
if (this.selectedOutputOption === 'string') {
|
||||||
this.domainObject.configuration.output = '';
|
this.domainObject.configuration.output = '';
|
||||||
} else {
|
} else {
|
||||||
this.domainObject.configuration.output = this.selectedOutputOption;
|
this.domainObject.configuration.output = this.selectedOutputOption;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
updateOutputOption(ev) {
|
updateOutputOption(ev) {
|
||||||
if (this.selectedOutputOption === this.outputOptions[2].key) {
|
if (this.selectedOutputOption === 'string') {
|
||||||
this.domainObject.configuration.output = '';
|
this.domainObject.configuration.output = '';
|
||||||
} else {
|
} else {
|
||||||
this.domainObject.configuration.output = this.selectedOutputOption;
|
this.domainObject.configuration.output = this.selectedOutputOption;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user