'是', self::NO => '否', }; } /** * 获取对应的颜色值 */ public function color(): string { return match ($this) { self::YES => '#4CAF50', // 绿色 self::NO => '#FF5252', // 红色 }; } }