-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Tom-Szendrey <Tom-Szendrey@users.noreply.github.com>
- Loading branch information
1 parent
d447dd0
commit f79bfae
Showing
12 changed files
with
161 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
packages/client/hmi-client/src/components/model/petrinet/tera-model-intervention.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<template> | ||
<div class="form"> | ||
<div class="label-col"> | ||
<label>Parameter name </label> | ||
<Dropdown :options="parameterOptions" v-model.lazy="name" @blur="updateIntervention" /> | ||
</div> | ||
<div class="label-col"> | ||
<label>Timestep</label> | ||
<tera-input-number v-model.lazy="timestep" @blur="updateIntervention" /> | ||
</div> | ||
<div class="label-col"> | ||
<label>Value</label> | ||
<tera-input-number v-model.lazy="value" @blur="updateIntervention" /> | ||
</div> | ||
<Button label="Delete" icon="pi pi-trash" @click="$emit('delete')" rounded text /> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { ref } from 'vue'; | ||
import { Intervention } from '@/types/Types'; | ||
import teraInputNumber from '@/components/widgets/tera-input-number.vue'; | ||
import Button from 'primevue/button'; | ||
import Dropdown from 'primevue/dropdown'; | ||
const props = defineProps<{ | ||
intervention: Intervention; | ||
parameterOptions: string[]; | ||
}>(); | ||
const emit = defineEmits(['update-value', 'delete']); | ||
const name = ref(props.intervention.name); | ||
const timestep = ref(props.intervention.timestep); | ||
const value = ref(props.intervention.value); | ||
function updateIntervention() { | ||
const intervention: Intervention = { | ||
name: name.value, | ||
timestep: timestep.value, | ||
value: value.value | ||
}; | ||
emit('update-value', intervention); | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
.form { | ||
display: flex; | ||
} | ||
.label-col { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 0.5rem; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.