fix(device-tree): color style of station node suffix

This commit is contained in:
yangsy
2025-11-03 16:50:02 +08:00
parent a83f8aa746
commit 4b3e5ed808

View File

@@ -130,7 +130,17 @@ const lineDeviceTreeData = computed<Record<string, TreeOption[]>>(() => {
label: stationName,
key: stationCode,
prefix: () => renderStationNodePrefix(station),
suffix: () => `(${onlineDevices?.length ?? 0}/${offlineDevices?.length ?? 0}/${devices?.length ?? 0})`,
suffix: () => {
return h('span', null, [
'(',
h('span', { style: { color: themeVars.value.successColor } }, `${onlineDevices?.length ?? 0}`),
'/',
h('span', { style: { color: themeVars.value.errorColor } }, `${offlineDevices?.length ?? 0}`),
'/',
`${devices?.length ?? 0}`,
')',
]);
},
children:
lineDevices.value[stationCode]?.[paneName]?.map<TreeOption>((dev) => {
const device = dev as NdmDeviceResultVO;