Commit 5fafe334ad1120a6adb878da8c018a26ec45e3d1
1 parent
18fc3f89
fix: DEFECT-1652 输入超长设备信息影响设备详情页查看了
Showing
1 changed file
with
10 additions
and
2 deletions
... | ... | @@ -5,7 +5,7 @@ |
5 | 5 | @register="register" |
6 | 6 | destroyOnClose |
7 | 7 | @close="closeDrawer" |
8 | - :title="deviceDetail.alias || deviceDetail.name" | |
8 | + :title="drawerTitle" | |
9 | 9 | width="80%" |
10 | 10 | > |
11 | 11 | <Tabs v-model:activeKey="activeKey" :size="size"> |
... | ... | @@ -58,7 +58,7 @@ |
58 | 58 | </BasicDrawer> |
59 | 59 | </template> |
60 | 60 | <script lang="ts"> |
61 | - import { defineComponent, ref } from 'vue'; | |
61 | + import { defineComponent, ref, computed } from 'vue'; | |
62 | 62 | import { BasicDrawer, useDrawerInner } from '/@/components/Drawer'; |
63 | 63 | |
64 | 64 | import { Tabs } from 'ant-design-vue'; |
... | ... | @@ -122,6 +122,13 @@ |
122 | 122 | emit('openGatewayDeviceDetail', { id: data.gatewayId }); |
123 | 123 | }; |
124 | 124 | |
125 | + const drawerTitle = computed(() => { | |
126 | + return ( | |
127 | + deviceDetail.value?.alias?.slice(0, 40) + '...' || | |
128 | + deviceDetail.value?.name?.slice(0, 40) + '...' | |
129 | + ); | |
130 | + }); | |
131 | + | |
125 | 132 | return { |
126 | 133 | size, |
127 | 134 | activeKey, |
... | ... | @@ -132,6 +139,7 @@ |
132 | 139 | tbDeviceId, |
133 | 140 | handleOpenTbDeviceDetail, |
134 | 141 | handleOpenGatewayDevice, |
142 | + drawerTitle, | |
135 | 143 | }; |
136 | 144 | }, |
137 | 145 | }); | ... | ... |