Display active condition's output in read only view

This commit is contained in:
Joshi 2020-01-26 22:19:27 -08:00
parent e912ab8f4e
commit 0beda1d053
2 changed files with 13 additions and 0 deletions

View File

@ -21,6 +21,8 @@
</template>
<script>
import ConditionClass from "@/plugins/condition/Condition";
export default {
inject: ['openmct'],
props: {
@ -41,7 +43,17 @@ export default {
mounted() {
this.openmct.objects.get(this.conditionIdentifier).then((obj => {
this.condition = obj;
this.conditionClass = new ConditionClass(this.condition, this.openmct);
this.conditionClass.on('conditionResultUpdated', this.handleConditionResult.bind(this));
}));
},
methods: {
handleConditionResult(args) {
this.$emit('condition-result-updated', {
id: this.conditionIdentifier,
result: args.data.result
})
}
}
}
</script>

View File

@ -44,6 +44,7 @@
</div>
<div v-else>
<Condition :condition-identifier="conditionIdentifier"
@condition-result-updated="handleConditionResult"
:current-condition-identifier="currentConditionIdentifier"
/>
</div>