数据目录阶段 1C:编辑中点开状态标识时写明保存或取消后再逐项审阅

This commit is contained in:
ThearchyHelios
2026-10-03 10:51:13 +08:00
parent fd475291bb
commit cd22175bfc
4 changed files with 10 additions and 5 deletions
+1
View File
@@ -2051,6 +2051,7 @@ export const CATALOG_TEXT = {
reset: (where: string) => `已恢复${where}`,
},
removed: (where: string) => `已删除${where}`,
reviewWhileEditing: '正在编辑这张表,保存或取消后再逐项审阅',
whereTable: (field: string) => `表的${field}`,
whereColumn: (col: string, field: string) => `列 ${col} 的${field}`,
whereRelation: (to: string) => `指向 ${to} 的关联关系`,
+1 -1
View File
@@ -101,7 +101,7 @@ const ColumnRow = memo(function ColumnRow({ col, editing, draft, initial, proble
<div className="min-w-0 flex-1">{editing ? input : view}</div>
{it && !changed && (
<span className="pt-0.5">
<ItemMark compact disabled={busy || editing}
<ItemMark compact disabled={busy || editing} disabledHint={editing ? CT.reviewWhileEditing : undefined}
target={{ path: columnPath(name, f), where, source: it.source, status: it.status, note: it.note, updated_at: it.updated_at }}
onReview={(a) => onReview({ path: columnPath(name, f), where, source: it.source, status: it.status }, a)} />
</span>
+1 -1
View File
@@ -486,7 +486,7 @@ function TableFieldRow({ field, item, edit, busy, problems, columns, onChange, o
<div className="min-w-0 flex-1 text-xs">{edit ? input : <FieldValue field={field} item={item} />}</div>
{item && !changed && (
<ItemMark target={{ path: tablePath(field), where, source: item.source, status: item.status, note: item.note, updated_at: item.updated_at }}
disabled={busy || !!edit}
disabled={busy || !!edit} disabledHint={edit ? CT.reviewWhileEditing : undefined}
onReview={(a) => onReview({ path: tablePath(field), where, source: item.source, status: item.status }, a)} />
)}
{changed && <span className="chip shrink-0 !text-2xs" style={{ color: 'var(--accent)' }} data-changed="">{CT.changedMark}</span>}
+7 -3
View File
@@ -108,11 +108,13 @@ export interface ReviewTarget {
* 不会被表格的横向滚动裁掉;滚动时跟着触发按钮走,滚出视野或改窗口大小时收起。键盘:Enter 打开,焦点落到第一个可点的操作,
* ←→↑↓ 在操作之间移动,Tab 在弹层里循环,Esc 收起并把焦点还给触发按钮
*/
export function ItemMark({ target, compact = false, disabled = false, onReview }: {
export function ItemMark({ target, compact = false, disabled = false, disabledHint, onReview }: {
target: ReviewTarget
compact?: boolean
/** 正在提交别的操作:弹层照常能看,操作按钮禁用 */
/** 正在提交别的操作、正在编辑:弹层照常能看,操作按钮禁用 */
disabled?: boolean
/** 禁用的原因,写在操作按钮下面 */
disabledHint?: string
onReview: (action: CatalogReviewAction) => void
}) {
const [open, setOpen] = useState(false)
@@ -269,7 +271,9 @@ export function ItemMark({ target, compact = false, disabled = false, onReview }
{human ? CT.remove : CT.reset}
</ActionButton>
</div>
{canReset && <p className="mt-2 text-2xs leading-relaxed text-faint">{human ? CT.removeHint : CT.resetHint}</p>}
{disabled && disabledHint
? <p className="mt-2 text-2xs leading-relaxed text-faint" data-review-disabled="">{disabledHint}</p>
: canReset && <p className="mt-2 text-2xs leading-relaxed text-faint">{human ? CT.removeHint : CT.resetHint}</p>}
</div>,
document.body,
)}