Commit 8ab0c5ad213149bb726bf13a73a9d807a0ce1f0b
1 parent
c2d90628
fix: DEFECT-945 show device alias if device has alias
Showing
3 changed files
with
8 additions
and
5 deletions
| @@ -21,6 +21,9 @@ export const descSchema = (emit: EmitType): DescItem[] => { | @@ -21,6 +21,9 @@ export const descSchema = (emit: EmitType): DescItem[] => { | ||
| 21 | { | 21 | { | 
| 22 | field: 'name', | 22 | field: 'name', | 
| 23 | label: '设备名称', | 23 | label: '设备名称', | 
| 24 | + render(val, data: Record<'alias' | 'name', string>) { | ||
| 25 | + return h('span', {}, data.alias || val); | ||
| 26 | + }, | ||
| 24 | }, | 27 | }, | 
| 25 | { | 28 | { | 
| 26 | field: 'label', | 29 | field: 'label', | 
| @@ -51,7 +54,7 @@ export const descSchema = (emit: EmitType): DescItem[] => { | @@ -51,7 +54,7 @@ export const descSchema = (emit: EmitType): DescItem[] => { | ||
| 51 | return h( | 54 | return h( | 
| 52 | Button, | 55 | Button, | 
| 53 | { type: 'link', style: { padding: 0 }, onClick: () => emit('open-gateway-device', data) }, | 56 | { type: 'link', style: { padding: 0 }, onClick: () => emit('open-gateway-device', data) }, | 
| 54 | - { default: () => val } | 57 | + { default: () => data.gatewayAlias || val } | 
| 55 | ); | 58 | ); | 
| 56 | }, | 59 | }, | 
| 57 | }, | 60 | }, | 
| @@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
| 5 | @register="register" | 5 | @register="register" | 
| 6 | destroyOnClose | 6 | destroyOnClose | 
| 7 | @close="closeDrawer" | 7 | @close="closeDrawer" | 
| 8 | - :title="deviceDetail.name" | 8 | + :title="deviceDetail.alias || deviceDetail.name" | 
| 9 | width="80%" | 9 | width="80%" | 
| 10 | > | 10 | > | 
| 11 | <Tabs v-model:activeKey="activeKey" :size="size"> | 11 | <Tabs v-model:activeKey="activeKey" :size="size"> | 
| @@ -2,9 +2,9 @@ | @@ -2,9 +2,9 @@ | ||
| 2 | <div style="background-color: #f0f2f5"> | 2 | <div style="background-color: #f0f2f5"> | 
| 3 | <BasicTable @register="registerTable"> | 3 | <BasicTable @register="registerTable"> | 
| 4 | <template #tbDeviceName="{ record }"> | 4 | <template #tbDeviceName="{ record }"> | 
| 5 | - <div style="color: #619eff" class="cursor-pointer" @click="handleGetTbDeviceId(record)">{{ | ||
| 6 | - record.tbDeviceName | ||
| 7 | - }}</div> | 5 | + <div style="color: #619eff" class="cursor-pointer" @click="handleGetTbDeviceId(record)"> | 
| 6 | + {{ record.alias || record.tbDeviceName }} | ||
| 7 | + </div> | ||
| 8 | </template> | 8 | </template> | 
| 9 | <template #deviceState="{ record }"> | 9 | <template #deviceState="{ record }"> | 
| 10 | <Tag | 10 | <Tag |