From 99b15c233de97b2d68b25df7412477abf60e2b76 Mon Sep 17 00:00:00 2001 From: zhengwr Date: Mon, 15 Jun 2026 17:24:02 +0800 Subject: [PATCH] =?UTF-8?q?feat(theme):=20=C2=A714=20=E6=9F=A5=E7=9C=8B(?= =?UTF-8?q?=E5=8F=AA=E8=AF=BB)=E6=80=81=E9=9A=90=E8=97=8F=E5=BF=85?= =?UTF-8?q?=E5=A1=AB=E6=98=9F=E5=8F=B7=20*?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 只读页的红 * 无意义。静态渲染的必填项 value 无输入控件(.cxd-TplField,无input), 用 :has 判定后隐藏 *;编辑态 value 含 input/Select → 不命中,* 照常。 实测:查看 5★全隐、修改 5★全显。 Co-Authored-By: Claude Opus 4.8 (1M context) --- src/shell/amis-theme.css | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/shell/amis-theme.css b/src/shell/amis-theme.css index 59c3930..c823f2b 100644 --- a/src/shell/amis-theme.css +++ b/src/shell/amis-theme.css @@ -449,3 +449,14 @@ .amis-scope .AMISCSSWrapper { --Form-input-fontSize: 13px; /* 与表格正文 13px 一致(原 14px) */ } + +/* ============================================================================ + 14. 查看(只读/静态)态隐藏必填星号 * — 2026-06-15 + 只读页的红 * 无意义(不可填、不校验)。静态渲染的必填项 value 部分是静态文本、 + 无输入控件(实测 .cxd-Form-value 内为 .cxd-TplField,无 input),据此 :has 判定 + 后隐藏 *;编辑态必填项 value 含 input/textarea/Select → 不命中,* 照常显示。 + (实测查看 5★全隐、修改 5★全显。) + ============================================================================ */ +.amis-scope .cxd-Form-item.is-required:not(:has(.cxd-Form-value input, .cxd-Form-value textarea, .cxd-Form-value .cxd-Select)) .cxd-Form-star { + display: none; +}