export class SlotRankingDataManager { static _instance: SlotRankingDataManager = null; static get instance(): SlotRankingDataManager { if (!this._instance) { this._instance = new SlotRankingDataManager(); } return this._instance; } _rankList: any = null; set rankList(list: any) { this._rankList = list; } get rankList(): any { return this._rankList; } getRankListStatus(): number { if (!this._rankList || !this._rankList.List || this._rankList.List.length === 0) { return 2; } let hasEnabled = false; // 是否有启用的 let hasMaintenance = false; // 是否有维护的 for (let item of this._rankList.List) { if (item.Status === 0) { hasEnabled = true; break; } else if (item.Status === 1) { hasMaintenance = true; } } if (hasEnabled) { return 0; } if (hasMaintenance) { return 1; } return 2; } getRankListServerId(): string | null { if (!this._rankList || !this._rankList.List || this._rankList.List.length === 0) { return null; } let id = this._rankList.List[0].Id; if (!id) { return null; } let parts = id.split('_'); if (parts.length >= 3) { return parts[2]; } return null; } getRankEndTimeByType(type: string): number | null { if (!this._rankList || !this._rankList.List || this._rankList.List.length === 0) { return null; } let item = this._rankList.List.find((item: any) => item.Type === type); return item ? item.EndTime : null; } getRankInfoByType(type: string): any | null { if (!this._rankList || !this._rankList.List || this._rankList.List.length === 0) { return null; } let item = this._rankList.List.find((item: any) => item.Type === type); return item || null; } }