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
<template>
<div class="text-14 text-center flex items-center blood-pressure-panel" @click="onSelect">
<doc-icon type="doc-thermometer" class="text-16"/>
<span v-if="!deviceInfo.data || deviceInfo.type != 3" class="text-center">
<span class="ml-2">选择设备</span>
</span>
<span v-else>
<span class="mx-2">{{ dataHandle(deviceInfo.data) }}</span>
<doc-icon type="doc-left-1" style="transform: rotate(180deg);"/>
</span>
</div>
</template>
<script>
export default {
name: 'BloodPressurePanel',
props: {
pressureObj: {
required: true,
default: () => ({})
}
},
computed: {
deviceInfo() {
return this.pressureObj.getDevice()
}
},
methods: {
onSelect() {
this.pressureObj.deviceSelect()
},
dataHandle(str) {
if (!str) return ''
return str.substring(0, 4) + '...' + str.substring(str.length - 4, str.length)
}
}
}
</script>
<style lang="less" scoped>
.blood-pressure-panel {
background-color: var(--van-primary-color);
color: #fff;
border-radius: 20px;
padding: 6px 12px;
min-width: 114px;
}
</style>