'启用', self::DISABLED => '禁用', }; } /** * 获取对应的颜色值 */ public function color(): string { return match ($this) { self::ENABLED => '#4CAF50', // 绿色 self::DISABLED => '#FF5252', // 红色 }; } }