-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMetadataSidebar.vue
182 lines (175 loc) · 5.36 KB
/
MetadataSidebar.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<template>
<div
id="dicom-metadata-sidebar"
class="dicom-metadata-sidebar .sidebar-panel oc-position-relative oc-height-1-1 oc-py-s oc-width-1-1 oc-width-1-2@s oc-width-1-3@m"
>
<div id="dicom-metadata-sidebar-header" class="sidebar-panel__header header">
<oc-button
v-oc-tooltip="backToMainDescription"
class="header__back oc-hidden@s"
appearance="raw"
:aria-label="backToMainDescription"
@click="$emit('closeMetadataSidebar')"
>
<oc-icon name="arrow-left-s" fill-type="line" />
</oc-button>
<h2 class="header__title oc-my-rm">{{ dicomMetadataSidebarTitle }}</h2>
<oc-button
v-oc-tooltip="hideMetadataDescription"
class="header__close"
appearance="raw"
:aria-label="hideMetadataDescription"
@click="$emit('closeMetadataSidebar')"
>
<oc-icon name="close" />
</oc-button>
</div>
<div v-if="isMetadataExtracted" id="dicom-metadata-sidebar-content" class="oc-p-s">
<table class="details-table">
<caption>Details table</caption>
<metadata-sidebar-table-row
v-bind="$props.patientInformation"
:metadata-section-name="'Patient Information'"
:metadata-section-data="$props.patientInformation"
:is-first-section="true"
/>
<metadata-sidebar-table-row
v-bind="$props.studyInformation"
:metadata-section-name="'Study Information'"
:metadata-section-data="$props.studyInformation"
:is-first-section="false"
/>
<metadata-sidebar-table-row
v-bind="$props.seriesInformation"
:metadata-section-name="'Series Information'"
:metadata-section-data="$props.seriesInformation"
:is-first-section="false"
/>
<metadata-sidebar-table-row
v-bind="$props.instanceInformation"
:metadata-section-name="'Instance Information'"
:metadata-section-data="$props.instanceInformation"
:is-first-section="false"
/>
<metadata-sidebar-table-row
v-bind="$props.imageInformation"
:metadata-section-name="'Image Information'"
:metadata-section-data="$props.imageInformation"
:is-first-section="false"
/>
<metadata-sidebar-table-row
v-bind="$props.equipmentInformation"
:metadata-section-name="'Equipment Information'"
:metadata-section-data="$props.equipmentInformation"
:is-first-section="false"
/>
<metadata-sidebar-table-row
v-bind="$props.scanningInformation"
:metadata-section-name="'Scanning Information'"
:metadata-section-data="$props.scanningInformation"
:is-first-section="false"
/>
<metadata-sidebar-table-row
v-bind="$props.uidsInformation"
:metadata-section-name="'UIDS Information'"
:metadata-section-data="$props.uidsInformation"
:is-first-section="false"
/>
<metadata-sidebar-table-row
v-bind="$props.otherInformation"
:metadata-section-name="'Other Information'"
:metadata-section-data="$props.otherInformation"
:is-first-section="false"
/>
</table>
</div>
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue'
import { useGettext } from 'vue3-gettext'
import MetadataSidebarTableRow from './MetadataSidebarTableRow.vue'
export default defineComponent({
name: 'MetadataSidebar',
components: {
MetadataSidebarTableRow
},
props: {
isMetadataExtracted: {
type: Boolean,
required: true,
default: false
},
patientInformation: {
type: Object,
required: true
},
studyInformation: {
type: Object,
required: true
},
seriesInformation: {
type: Object,
required: true
},
instanceInformation: {
type: Object,
required: true
},
imageInformation: {
type: Object,
required: true
},
equipmentInformation: {
type: Object,
required: true
},
scanningInformation: {
type: Object,
required: true
},
uidsInformation: {
type: Object,
required: true
},
otherInformation: {
type: Object,
required: true
}
},
emits: ['closeMetadataSidebar'],
setup(props, { emit }) {
const { $gettext } = useGettext()
return {
dicomMetadataSidebarTitle: $gettext('DICOM metadata'),
hideMetadataDescription: $gettext('Hide DICOM metadata'),
backToMainDescription: $gettext('Back to DICOM viewer')
}
}
})
</script>
<style lang="scss" scoped>
.dicom-metadata-sidebar {
border-left: 1px solid var(--oc-color-border);
position: relative;
overflow: hidden;
max-width: var(--oc-breakpoint-medium-default);
}
#dicom-metadata-sidebar-header {
border-bottom: 1px solid var(--oc-color-border);
padding-bottom: var(--oc-space-medium);
}
#dicom-metadata-sidebar-content {
height: calc(100% - 55px);
// bottom of sidebar content is cut off without this offset
// the amount of 55px was determined by manual testing with chrome on mac
// seems to be related to amount of padding being added to sidebar header
overflow-y: scroll;
}
#dicom-metadata-sidebar-content table {
width: 100%;
}
.details-table tr {
height: 1rem; // reducing height, originally 1.5rem
}
</style>