Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
HUB Terra
SMS
Frontend
Commits
9ea81fc5
Commit
9ea81fc5
authored
4 years ago
by
Nils Brinckmann
Browse files
Options
Downloads
Patches
Plain Diff
Use DevicePropertyInfo component
parent
b510fe65
No related branches found
No related tags found
3 merge requests
!90
Draft: restructure frontend properties 2
,
!85
Form for measured quantities
,
!82
Restructure frontend
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pages/devices/_deviceId/measuredquantities.vue
+13
-112
13 additions, 112 deletions
pages/devices/_deviceId/measuredquantities.vue
with
13 additions
and
112 deletions
pages/devices/_deviceId/measuredquantities.vue
+
13
−
112
View file @
9ea81fc5
...
...
@@ -154,62 +154,14 @@ permissions and limitations under the Licence.
/>
</
template
>
<
template
v-else
>
<div>
<v-row
dense
>
<v-col
cols=
"12"
md=
"3"
>
<label>
Label:
</label>
{{
property
.
label
}}
</v-col>
</v-row>
<v-row>
<v-col
cols=
"12"
md=
"3"
>
<label>
Compartment
</label>
{{
compartmentValue
(
property
)
|
orDefault
}}
</v-col>
<v-col
cols=
"12"
md=
"3"
>
<label>
Sampling Media
</label>
{{
samplingMediaValue
(
property
)
|
orDefault
}}
</v-col>
<v-col
cols=
"12"
md=
"3"
>
<label>
Measured Quantity
</label>
{{
measuredQuantityValue
(
property
)
|
orDefault
}}
</v-col>
</v-row>
<v-row>
<v-col
cols=
"12"
md=
"3"
>
<label>
Unit
</label>
{{
unitValue
(
property
)
|
orDefault
}}
</v-col>
<v-col
cols=
"12"
md=
"3"
>
<label>
Measuring range min
</label>
{{
property
.
measuringRange
.
min
|
orDefault
}}
</v-col>
<v-col
cols=
"12"
md=
"3"
>
<label>
Measuring range max
</label>
{{
property
.
measuringRange
.
max
|
orDefault
}}
</v-col>
</v-row>
<v-row>
<v-col
cols=
"12"
md=
"3"
>
<label>
Accuracy
</label>
{{
property
.
accuracy
|
orDefault
}}
</v-col>
<v-col
cols=
"12"
md=
"3"
>
<label>
Failure Value
</label>
{{
property
.
failureValue
|
orDefault
}}
</v-col>
</v-row>
<v-row>
<v-col
cols=
"12"
md=
"3"
>
<label>
Resolution
</label>
{{
property
.
resolution
|
orDefault
}}
</v-col>
<v-col
cols=
"12"
md=
"3"
>
<label>
Unit of Resolution
</label>
{{
resolutionUnitValue
(
property
)
|
orDefault
}}
</v-col>
</v-row>
</div>
<DevicePropertyInfo
v-model=
"deviceProperties[index]"
:compartments=
"compartments"
:sampling-medias=
"samplingMedias"
:properties=
"properties"
:units=
"units"
:measured-quantity-units=
"measuredQuantityUnits"
/>
</
template
>
</v-expansion-panel-content>
</v-expansion-panel>
...
...
@@ -233,6 +185,9 @@ permissions and limitations under the Licence.
<
script
lang=
"ts"
>
import
{
Component
,
Vue
}
from
'
nuxt-property-decorator
'
import
DevicePropertyInfo
from
'
@/components/DevicePropertyInfo.vue
'
import
{
DeviceProperty
}
from
'
@/models/DeviceProperty
'
import
{
Compartment
}
from
'
@/models/Compartment
'
import
{
Property
}
from
'
@/models/Property
'
...
...
@@ -244,7 +199,8 @@ import ProgressIndicator from '@/components/ProgressIndicator.vue'
@
Component
({
components
:
{
ProgressIndicator
ProgressIndicator
,
DevicePropertyInfo
}
})
export
default
class
DevicePropertiesPage
extends
Vue
{
...
...
@@ -390,60 +346,5 @@ export default class DevicePropertiesPage extends Vue {
cancelEditMode
()
{
this
.
$router
.
push
(
'
/devices/
'
+
this
.
deviceId
+
'
/measuredquantities
'
)
}
compartmentValue
(
property
:
DeviceProperty
):
string
{
if
(
!
property
.
compartmentName
&&
!
property
.
compartmentUri
)
{
return
''
}
const
compartment
=
this
.
compartments
.
find
(
c
=>
c
.
uri
===
property
.
compartmentUri
)
if
(
compartment
)
{
return
compartment
.
name
}
return
property
.
compartmentName
}
samplingMediaValue
(
property
:
DeviceProperty
):
string
{
if
(
!
property
.
samplingMediaName
&&
!
property
.
samplingMediaUri
)
{
return
''
}
const
samplingMedia
=
this
.
samplingMedias
.
find
(
c
=>
c
.
uri
===
property
.
samplingMediaUri
)
if
(
samplingMedia
)
{
return
samplingMedia
.
name
}
return
property
.
samplingMediaName
}
measuredQuantityValue
(
propertyEntity
:
DeviceProperty
):
string
{
if
(
!
propertyEntity
.
propertyName
&&
!
propertyEntity
.
propertyUri
)
{
return
''
}
const
property
=
this
.
properties
.
find
(
c
=>
c
.
uri
===
propertyEntity
.
propertyUri
)
if
(
property
)
{
return
property
.
name
}
return
propertyEntity
.
propertyName
}
unitValue
(
property
:
DeviceProperty
):
string
{
if
(
!
property
.
unitName
&&
!
property
.
unitUri
)
{
return
''
}
const
unit
=
this
.
units
.
find
(
c
=>
c
.
uri
===
property
.
unitUri
)
if
(
unit
)
{
return
unit
.
name
}
return
property
.
unitName
}
resolutionUnitValue
(
property
:
DeviceProperty
):
string
{
if
(
!
property
.
resolutionUnitName
&&
!
property
.
resolutionUnitUri
)
{
return
''
}
const
unit
=
this
.
units
.
find
(
c
=>
c
.
uri
===
property
.
resolutionUnitUri
)
if
(
unit
)
{
return
unit
.
name
}
return
property
.
resolutionUnitName
}
}
</
script
>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment