diff --git a/aas-web-ui/src/components/SubmodelElements/AnnotatedRelationshipElement.vue b/aas-web-ui/src/components/SubmodelElements/AnnotatedRelationshipElement.vue index a254498..7a8ebc3 100644 --- a/aas-web-ui/src/components/SubmodelElements/AnnotatedRelationshipElement.vue +++ b/aas-web-ui/src/components/SubmodelElements/AnnotatedRelationshipElement.vue @@ -15,8 +15,9 @@ + :submodel-element-object="SubmodelElement" + :card-style="'outlined'" + :is-editable="isEditable"> @@ -32,7 +33,16 @@ RelationshipElement, // SubmodelElementWrapper, }, - props: ['annotatedRelationshipElementObject'], + props: { + annotatedRelationshipElementObject: { + type: Object, + default: () => ({}), + }, + isEditable: { + type: Boolean, + default: true, + }, + }, setup() { const SubmodelElementWrapper = shallowRef(null) as any; diff --git a/aas-web-ui/src/components/SubmodelElements/Blob.vue b/aas-web-ui/src/components/SubmodelElements/Blob.vue index a9c6aee..1fe4e73 100644 --- a/aas-web-ui/src/components/SubmodelElements/Blob.vue +++ b/aas-web-ui/src/components/SubmodelElements/Blob.vue @@ -34,7 +34,8 @@ variant="outlined" density="compact" :hide-details="isTruncated ? false : true" - clearable + :clearable="isEditable" + :readonly="!isEditable" :hint="isTruncated ? 'Blob string is truncated!' : ''" persistent-hint @keydown.enter="updateBlob()" @@ -43,7 +44,7 @@ - + @@ -99,7 +100,16 @@ export default defineComponent({ name: 'Blob', mixins: [RequestHandling, SubmodelElementHandling], - props: ['blobObject'], + props: { + blobObject: { + type: Object, + default: () => ({}), + }, + isEditable: { + type: Boolean, + default: true, + }, + }, setup() { const aasStore = useAASStore(); diff --git a/aas-web-ui/src/components/SubmodelElements/Entity.vue b/aas-web-ui/src/components/SubmodelElements/Entity.vue index 287522f..8922023 100644 --- a/aas-web-ui/src/components/SubmodelElements/Entity.vue +++ b/aas-web-ui/src/components/SubmodelElements/Entity.vue @@ -77,7 +77,12 @@ SubmodelElementGroup, }, mixins: [SubmodelElementHandling], - props: ['entityObject'], + props: { + entityObject: { + type: Object, + default: () => ({}), + }, + }, setup() { const aasStore = useAASStore(); diff --git a/aas-web-ui/src/components/SubmodelElements/File.vue b/aas-web-ui/src/components/SubmodelElements/File.vue index 3b20841..ae87048 100644 --- a/aas-web-ui/src/components/SubmodelElements/File.vue +++ b/aas-web-ui/src/components/SubmodelElements/File.vue @@ -35,14 +35,15 @@ variant="outlined" density="compact" hide-details - clearable + :clearable="isEditable" + :readonly="!isEditable" @keydown.enter="updatePath()" @click:clear="clearPath()" @update:focused="setFocus"> - + @@ -109,7 +110,16 @@ export default defineComponent({ name: 'File', mixins: [RequestHandling, SubmodelElementHandling], - props: ['fileObject'], + props: { + fileObject: { + type: Object, + default: () => ({}), + }, + isEditable: { + type: Boolean, + default: true, + }, + }, setup() { const aasStore = useAASStore(); diff --git a/aas-web-ui/src/components/SubmodelElements/MultiLanguageProperty.vue b/aas-web-ui/src/components/SubmodelElements/MultiLanguageProperty.vue index 5305900..1265b72 100644 --- a/aas-web-ui/src/components/SubmodelElements/MultiLanguageProperty.vue +++ b/aas-web-ui/src/components/SubmodelElements/MultiLanguageProperty.vue @@ -14,8 +14,9 @@ variant="outlined" density="compact" hide-details - clearable - append-icon="mdi-delete" + :clearable="isEditable" + :readonly="!isEditable" + :append-icon="isEditable ? 'mdi-delete' : undefined" @click:append="removeEntry(i)" @update:focused="setFocus($event, value)" @keydown.enter="updateValue()"> @@ -23,9 +24,11 @@ {{ value.language ? value.language : 'no-lang' }} - mdi-chevron-down + + mdi-chevron-down + - + - + ({}), + }, + isEditable: { + type: Boolean, + default: true, + }, + }, setup() { const aasStore = useAASStore(); diff --git a/aas-web-ui/src/components/SubmodelElements/Operation.vue b/aas-web-ui/src/components/SubmodelElements/Operation.vue index aa96e13..075bbdf 100644 --- a/aas-web-ui/src/components/SubmodelElements/Operation.vue +++ b/aas-web-ui/src/components/SubmodelElements/Operation.vue @@ -39,12 +39,14 @@ :property-object="variable.value" :is-operation-variable="true" :variable-type="variableType.type" + :is-editable="isEditable" @update-value="updateOperationVariable($event, variable.value)"> @@ -80,7 +82,13 @@ - clear @@ -120,7 +128,16 @@ InvalidElement, }, mixins: [RequestHandling, SubmodelElementHandling], - props: ['operationObject'], + props: { + operationObject: { + type: Object, + default: () => ({}), + }, + isEditable: { + type: Boolean, + default: true, + }, + }, setup() { const navigationStore = useNavigationStore(); diff --git a/aas-web-ui/src/components/SubmodelElements/Property.vue b/aas-web-ui/src/components/SubmodelElements/Property.vue index 7d09eb8..3c46b27 100644 --- a/aas-web-ui/src/components/SubmodelElements/Property.vue +++ b/aas-web-ui/src/components/SubmodelElements/Property.vue @@ -46,24 +46,28 @@ :number-value="propertyObject" :is-operation-variable="isOperationVariable" :variable-type="variableType" + :is-editable="isEditable" @update-value="updateValue"> @@ -90,7 +94,24 @@ DateTimeStampType, }, mixins: [RequestHandling, SubmodelElementHandling], - props: ['propertyObject', 'isOperationVariable', 'variableType'], + props: { + propertyObject: { + type: Object, + default: () => ({}), + }, + isOperationVariable: { + type: Boolean, + default: false, + }, + variableType: { + type: String, + default: 'string', + }, + isEditable: { + type: Boolean, + default: true, + }, + }, setup() { const aasStore = useAASStore(); diff --git a/aas-web-ui/src/components/SubmodelElements/Range.vue b/aas-web-ui/src/components/SubmodelElements/Range.vue index 724a9f8..9a66e06 100644 --- a/aas-web-ui/src/components/SubmodelElements/Range.vue +++ b/aas-web-ui/src/components/SubmodelElements/Range.vue @@ -36,7 +36,12 @@ export default defineComponent({ name: 'Range', mixins: [RequestHandling, SubmodelElementHandling], - props: ['rangeObject'], + props: { + rangeObject: { + type: Object, + default: () => ({}), + }, + }, setup() { const aasStore = useAASStore(); diff --git a/aas-web-ui/src/components/SubmodelElements/ReferenceElement.vue b/aas-web-ui/src/components/SubmodelElements/ReferenceElement.vue index 1e2beea..613fb44 100644 --- a/aas-web-ui/src/components/SubmodelElements/ReferenceElement.vue +++ b/aas-web-ui/src/components/SubmodelElements/ReferenceElement.vue @@ -38,7 +38,8 @@ variant="outlined" density="compact" hide-details - clearable + :clearable="isEditable" + :readonly="!isEditable" append-icon="mdi-delete" @click:append="removeReferenceEntry(i)" @update:focused="setFocus($event)" @@ -49,7 +50,7 @@ {{ value.type ? value.type : 'no-selection' }} mdi-chevron-down - + ({}), + }, + isOperationVariable: { + type: Boolean, + default: false, + }, + variableType: { + type: String, + default: 'number', + }, + isEditable: { + type: Boolean, + default: true, + }, + }, setup() { const aasStore = useAASStore(); diff --git a/aas-web-ui/src/components/SubmodelElements/RelationshipElement.vue b/aas-web-ui/src/components/SubmodelElements/RelationshipElement.vue index 845e34d..8efc9d4 100644 --- a/aas-web-ui/src/components/SubmodelElements/RelationshipElement.vue +++ b/aas-web-ui/src/components/SubmodelElements/RelationshipElement.vue @@ -20,13 +20,13 @@ - + Description: {{ value.type }} - + {{ value.value }} @@ -73,7 +73,12 @@ export default defineComponent({ name: 'RelationshipElement', mixins: [SubmodelElementHandling], - props: ['relationshipElementObject'], + props: { + relationshipElementObject: { + type: Object, + default: () => ({}), + }, + }, setup() { const aasStore = useAASStore(); diff --git a/aas-web-ui/src/components/SubmodelElements/ValueTypes/BooleanType.vue b/aas-web-ui/src/components/SubmodelElements/ValueTypes/BooleanType.vue index ea8f15b..d1f02ca 100644 --- a/aas-web-ui/src/components/SubmodelElements/ValueTypes/BooleanType.vue +++ b/aas-web-ui/src/components/SubmodelElements/ValueTypes/BooleanType.vue @@ -5,7 +5,7 @@ v-model="newBooleanValue" inset density="compact" - :readonly="IsOutputVariable" + :readonly="IsOutputVariable || !isEditable" color="primary" :messages=" isOperationVariable ? '' : 'greyed out value on the right shows the current value in the AAS' @@ -17,9 +17,10 @@ + ({}), + }, + isOperationVariable: { + type: Boolean, + default: false, + }, + variableType: { + type: String, + default: 'number', + }, + isEditable: { + type: Boolean, + default: true, + }, + }, setup() { const aasStore = useAASStore(); diff --git a/aas-web-ui/src/components/SubmodelElements/ValueTypes/DateTimeStampType.vue b/aas-web-ui/src/components/SubmodelElements/ValueTypes/DateTimeStampType.vue index 22d1df1..f7c1a25 100644 --- a/aas-web-ui/src/components/SubmodelElements/ValueTypes/DateTimeStampType.vue +++ b/aas-web-ui/src/components/SubmodelElements/ValueTypes/DateTimeStampType.vue @@ -6,7 +6,8 @@ type="text" variant="outlined" density="compact" - clearable + :clearable="isEditable" + :readonly="!isEditable" :color="dateTimeStampValue.value == newDateTimeStampValue ? '' : 'warning'" :persistent-hint="!IsOperationVariable" :hint="dateTimeStampValue.value == newDateTimeStampValue ? '' : 'Current Value not yet saved.'" @@ -18,7 +19,7 @@ {{ unitSuffix(dateTimeStampValue) }} ({}), + }, + isOperationVariable: { + type: Boolean, + default: false, + }, + variableType: { + type: String, + default: 'number', + }, + isEditable: { + type: Boolean, + default: true, + }, + }, setup() { const aasStore = useAASStore(); diff --git a/aas-web-ui/src/components/SubmodelElements/ValueTypes/NumberType.vue b/aas-web-ui/src/components/SubmodelElements/ValueTypes/NumberType.vue index 6e438b5..6cf413a 100644 --- a/aas-web-ui/src/components/SubmodelElements/ValueTypes/NumberType.vue +++ b/aas-web-ui/src/components/SubmodelElements/ValueTypes/NumberType.vue @@ -6,8 +6,8 @@ type="number" variant="outlined" density="compact" - clearable - :readonly="IsOutputVariable" + :clearable="isEditable" + :readonly="IsOutputVariable || !isEditable" :hint="isOperationVariable ? '' : 'greyed out value on the left shows the current value in the AAS'" :label="isOperationVariable ? numberValue.idShort : ''" :hide-details="IsOperationVariable ? true : false" @@ -36,7 +36,7 @@ {{ unitSuffix(numberValue) }} ({}), + }, + isOperationVariable: { + type: Boolean, + default: false, + }, + variableType: { + type: String, + default: 'number', + }, + isEditable: { + type: Boolean, + default: true, + }, + }, setup() { const aasStore = useAASStore(); diff --git a/aas-web-ui/src/components/SubmodelElements/ValueTypes/StringType.vue b/aas-web-ui/src/components/SubmodelElements/ValueTypes/StringType.vue index 9716cbd..1c3f47c 100644 --- a/aas-web-ui/src/components/SubmodelElements/ValueTypes/StringType.vue +++ b/aas-web-ui/src/components/SubmodelElements/ValueTypes/StringType.vue @@ -5,8 +5,8 @@ v-model="newStringValue" variant="outlined" density="compact" - clearable - :readonly="IsOutputVariable" + :clearable="isEditable" + :readonly="IsOutputVariable || !isEditable" auto-grow :rows="1" :label="isOperationVariable ? stringValue.idShort : ''" @@ -15,7 +15,7 @@ ({}), + }, + isOperationVariable: { + type: Boolean, + default: false, + }, + variableType: { + type: String, + default: 'number', + }, + isEditable: { + type: Boolean, + default: true, + }, + }, setup() { const aasStore = useAASStore(); diff --git a/aas-web-ui/src/components/UIComponents/GenericDataVisu.vue b/aas-web-ui/src/components/UIComponents/GenericDataVisu.vue index c1cccf7..e3cedf9 100644 --- a/aas-web-ui/src/components/UIComponents/GenericDataVisu.vue +++ b/aas-web-ui/src/components/UIComponents/GenericDataVisu.vue @@ -8,24 +8,38 @@ + :property-object="submodelElement" + :is-editable="false"> + :multi-language-property-object="submodelElement" + :is-editable="false"> - - + :operation-object="submodelElement" + :is-editable="false"> + + + :reference-element-object="submodelElement" + :is-editable="false"> @@ -37,7 +51,8 @@ :relationship-element-object="submodelElement"> + :annotated-relationship-element-object="submodelElement" + :is-editable="false"> diff --git a/aas-web-ui/src/components/UIComponents/SubmodelElementWrapper.vue b/aas-web-ui/src/components/UIComponents/SubmodelElementWrapper.vue index b516440..455a391 100644 --- a/aas-web-ui/src/components/UIComponents/SubmodelElementWrapper.vue +++ b/aas-web-ui/src/components/UIComponents/SubmodelElementWrapper.vue @@ -3,27 +3,35 @@ + v-if="submodelElementObject.modelType == 'MultiLanguageProperty'" + :multi-language-property-object="submodelElementObject" + :is-editable="isEditable"> - - + + + v-if="submodelElementObject.modelType == 'Operation'" + :operation-object="submodelElementObject" + :is-editable="isEditable"> - + v-if="submodelElementObject.modelType == 'ReferenceElement'" + :reference-element-object="submodelElementObject" + :is-editable="isEditable"> + + v-if="submodelElementObject.modelType == 'RelationshipElement'" + :relationship-element-object="submodelElementObject"> + v-if="submodelElementObject.modelType == 'AnnotatedRelationshipElement'" + :annotated-relationship-element-object="submodelElementObject" + :is-editable="isEditable"> @@ -41,6 +49,8 @@ import ReferenceElement from '@/components/SubmodelElements/ReferenceElement.vue'; import RelationshipElement from '@/components/SubmodelElements/RelationshipElement.vue'; + type Variant = 'elevated' | 'outlined' | 'flat' | 'text' | 'tonal' | 'plain' | undefined; + export default defineComponent({ name: 'SubmodelELementWrapper', components: { @@ -55,7 +65,20 @@ RelationshipElement, AnnotatedRelationshipElement, }, - props: ['SubmodelElementObject', 'cardStyle'], + props: { + submodelElementObject: { + type: Object, + default: () => ({}), + }, + cardStyle: { + type: String as () => Variant, + default: 'elevated', + }, + isEditable: { + type: Boolean, + default: true, + }, + }, methods: { // Function to update the value of a property