refactor(station): inrerface Station
This commit is contained in:
@@ -2,5 +2,5 @@ export interface Station {
|
|||||||
code: string;
|
code: string;
|
||||||
name: string;
|
name: string;
|
||||||
online: boolean;
|
online: boolean;
|
||||||
ip?: string;
|
ip: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ function useLineStationsMutation() {
|
|||||||
code: station.code ?? '',
|
code: station.code ?? '',
|
||||||
name: station.name ?? '',
|
name: station.name ?? '',
|
||||||
online: false,
|
online: false,
|
||||||
|
ip: '',
|
||||||
}));
|
}));
|
||||||
if (stationVerifyMode.value === 'concurrent') {
|
if (stationVerifyMode.value === 'concurrent') {
|
||||||
// 方案一:并发ping所有station
|
// 方案一:并发ping所有station
|
||||||
@@ -60,7 +61,7 @@ function useLineStationsMutation() {
|
|||||||
return {
|
return {
|
||||||
...station,
|
...station,
|
||||||
online: !!verifyList.find((stn) => stn.stationCode === station.code)?.onlineState,
|
online: !!verifyList.find((stn) => stn.stationCode === station.code)?.onlineState,
|
||||||
ip: verifyList.find((stn) => stn.stationCode === station.code)?.ipAddress,
|
ip: verifyList.find((stn) => stn.stationCode === station.code)?.ipAddress ?? '',
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user