Commit 1c115cc3 by luoqi

feat(web): 放回左栏「真」号码筛选(标签筛选仍隐藏)

原来两个入口共用一个 RAIL_FILTERS_VISIBLE,只要电话这个就得拆开:
  PHONE_FILTER_VISIBLE = true   ← 放回
  TAG_FILTER_VISIBLE   = false  ← 仍隐藏

外层条件跟着两个开关一起判 —— 只判其中一个的话,以后放开另一个时
整排还是不显示,而且不会报错。

服务端谓词一直都在(plan.service.ts 的 patientWhere.phoneVerified),
这次只是把入口露出来;realPhoneOnly 初值仍是"不筛",不会出现看不见的筛选。
`!hasPatientArchive` 守卫保留:宿主自带患者档案时号码整个不展示,
筛「真」没有意义(同 PatientRow 的 hidePhone 判据)。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
parent 1de76e9a
Pipeline #3525 failed in 0 seconds
......@@ -57,14 +57,18 @@ const VIEW_TABS: Array<{ v: View; label: string; requires?: Permission }> = [
];
/**
* 左栏那一排筛选(「真」号码 + 「筛选标签」)—— 暂时隐藏(2026-08-04 产品走查)。
* 置 `true` 即恢复;⛔ 不是删除,`PersonaTagFilter` 与 `phoneVerified` 那条服务端谓词都留着。
* 左栏那一排筛选的可见性 —— 两个入口**分开控**(2026-08-04 产品走查先一起藏,
* 随后单独放回「真」号码)。⛔ 不是删除,`PersonaTagFilter` 与 `phoneVerified`
* 那条服务端谓词(plan.service.ts 的 `patientWhere.phoneVerified`)都一直留着。
*
* ⚠️ 藏的只是**入口**。`realPhoneOnly` / `tags` 两个 state 初值都是"不筛",
* ⚠️ 藏的只是**入口**。`realPhoneOnly` / `tags` 两个 state 初值都是"不筛",
* 所以藏起来之后请求里不会残留任何筛选条件 —— ⛔ 别改它们的初值,
* 否则会出现"看不见的筛选"(列表少人而主管找不到原因)。
*/
const RAIL_FILTERS_VISIBLE: boolean = false;
/** 「真」号码筛选(只看已核实的真实手机号) */
const PHONE_FILTER_VISIBLE: boolean = true;
/** 画像标签筛选 —— 仍隐藏 */
const TAG_FILTER_VISIBLE: boolean = false;
export function PatientPickerRail({
currentPlanId,
......@@ -384,13 +388,17 @@ export function PatientPickerRail({
className="h-7 w-full rounded-md border border-slate-100 bg-slate-50 pl-7 pr-2 text-[12px] outline-none placeholder:text-slate-400 focus:border-brand-300 focus:bg-white"
/>
</div>
{RAIL_FILTERS_VISIBLE && (
{/* ⚠️ 外层条件要跟着两个开关走 —— 只判其中一个,另一个放开时整排还是不显示。
`hasPatientArchive`(宿主自带患者档案)时号码整个不展示,「真」筛选也就没意义,
这层守卫别顺手删(下面 PatientRow 的 `hidePhone` 是同一个判据)。 */}
{((PHONE_FILTER_VISIBLE && !hasPatientArchive) || TAG_FILTER_VISIBLE) && (
<div className="flex items-center gap-1.5">
{!hasPatientArchive && (
{PHONE_FILTER_VISIBLE && !hasPatientArchive && (
<button
type="button"
onClick={() => setRealPhoneOnly((v) => !v)}
title="只看已核实的真实手机号"
aria-pressed={realPhoneOnly}
className={cn(
'inline-flex h-6 items-center gap-1 rounded-md border px-1.5 text-[11px] transition-colors',
realPhoneOnly
......@@ -401,7 +409,9 @@ export function PatientPickerRail({
<PhoneCall className="h-3 w-3" />
</button>
)}
{TAG_FILTER_VISIBLE && (
<PersonaTagFilter selected={tags} onToggle={toggleTag} onClear={() => setTags(new Set())} />
)}
</div>
)}
{clinicOptions.length > 1 && (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment