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 | 21 | { |
| 22 | 22 | field: 'name', |
| 23 | 23 | label: '设备名称', |
| 24 | + render(val, data: Record<'alias' | 'name', string>) { | |
| 25 | + return h('span', {}, data.alias || val); | |
| 26 | + }, | |
| 24 | 27 | }, |
| 25 | 28 | { |
| 26 | 29 | field: 'label', |
| ... | ... | @@ -51,7 +54,7 @@ export const descSchema = (emit: EmitType): DescItem[] => { |
| 51 | 54 | return h( |
| 52 | 55 | Button, |
| 53 | 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 | }, | ... | ... |
| ... | ... | @@ -2,9 +2,9 @@ |
| 2 | 2 | <div style="background-color: #f0f2f5"> |
| 3 | 3 | <BasicTable @register="registerTable"> |
| 4 | 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 | 8 | </template> |
| 9 | 9 | <template #deviceState="{ record }"> |
| 10 | 10 | <Tag | ... | ... |