feat(qa-ops): 完成复检留档与人工复核闭环
治理侧保存输入观测版本、自动复检及人工复核历史,输入变化失效、版本冲突和幂等重放不覆盖人工记录。批量质量数量使用完整筛选元数据,未采集原文不伪造快照,延迟旧扫描不回退新输入。 验证:全仓 make verify 退出码0,Go656及前端253通过;五包竞态、源/组织/质量隔离PG、真实只读源和隔离网页读回复核通过。默认91个可选集成跳过不计通过。未接AI模型,不写DobotAI源库,未推送、未合并、未部署。
This commit is contained in:
@@ -7,9 +7,13 @@ import './qaOps.css'
|
||||
import { QARegions } from './QARegions'
|
||||
import { QAUsage } from './QAUsage'
|
||||
import { QAMonthly } from './QAMonthly'
|
||||
import { QAQualityEditor, QAQualityCounts } from './QAQuality'
|
||||
import { qualityLabels } from './qaQuality'
|
||||
import { usageLabels } from './qaUsage'
|
||||
|
||||
interface ViewProps {
|
||||
onQualitySaved?: (record: QARecord) => void
|
||||
onReloadDetail?: () => void
|
||||
page: QARecordPage | null
|
||||
status: QAStatus | null
|
||||
loading: boolean
|
||||
@@ -96,7 +100,10 @@ export function QAOperationsView(props: ViewProps) {
|
||||
>
|
||||
<span
|
||||
className={
|
||||
key === 'coverage' && item.coverage.verdict === 'uncovered' ? 'qa-ops-uncovered' : ''
|
||||
key === 'coverage' &&
|
||||
(item.quality?.effective.coverage ?? item.coverage.verdict) === 'uncovered'
|
||||
? 'qa-ops-uncovered'
|
||||
: ''
|
||||
}
|
||||
>
|
||||
{qaCellValue(item, key) ?? '—'}
|
||||
@@ -111,6 +118,9 @@ export function QAOperationsView(props: ViewProps) {
|
||||
>
|
||||
详情
|
||||
</button>
|
||||
{item.quality ? (
|
||||
<small className="qa-quality-state">{qualityLabels[item.quality.state]}</small>
|
||||
) : null}
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
@@ -149,7 +159,9 @@ export function QAOperationsView(props: ViewProps) {
|
||||
if (event.key === 'Escape') props.onCloseDetail()
|
||||
if (event.key === 'Tab') {
|
||||
const buttons = Array.from(
|
||||
event.currentTarget.querySelectorAll<HTMLElement>('button, a[href], input, [tabindex="0"]')
|
||||
event.currentTarget.querySelectorAll<HTMLElement>(
|
||||
'button:not([disabled]), a[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex="0"]'
|
||||
)
|
||||
)
|
||||
const first = buttons[0],
|
||||
last = buttons[buttons.length - 1]
|
||||
@@ -242,6 +254,17 @@ export function QAOperationsView(props: ViewProps) {
|
||||
{detail.source_coverage.evaluator_version || '无版本'}
|
||||
</p>
|
||||
<p className="qa-ops-muted">{detail.source_coverage.reason_code || '未记录判定原因'}</p>
|
||||
{detail.quality ? (
|
||||
<QAQualityEditor
|
||||
key={detail.id}
|
||||
recordId={detail.id}
|
||||
quality={detail.quality}
|
||||
onSaved={props.onQualitySaved ?? (() => {})}
|
||||
onReload={props.onReloadDetail ?? (() => {})}
|
||||
/>
|
||||
) : (
|
||||
<p className="qa-ops-muted">质量留档/人工复核未配置。</p>
|
||||
)}
|
||||
<h4>用户反馈</h4>
|
||||
<p>
|
||||
提问人:
|
||||
@@ -287,6 +310,7 @@ export function QAOperations() {
|
||||
const [error, setError] = useState<string | null>(null)
|
||||
const [loading, setLoading] = useState(false)
|
||||
const [revision, setRevision] = useState(0)
|
||||
const [qualityRevision, setQualityRevision] = useState(0)
|
||||
const [detail, setDetail] = useState<QARecord | null>(null)
|
||||
const [detailLoading, setDetailLoading] = useState(false)
|
||||
const [detailError, setDetailError] = useState<string | null>(null)
|
||||
@@ -481,6 +505,7 @@ export function QAOperations() {
|
||||
<p className="qa-ops-slice-note">
|
||||
部门/区域保留源快照,缺失时按当前通讯录补全;使用统计不是绩效结论。外语翻译与AI评估仍暂缓,空值不默认填“否”。
|
||||
</p>
|
||||
{view === 'records' ? <QAQualityCounts query={query} revision={qualityRevision} /> : null}
|
||||
{view === 'usage' ? (
|
||||
<QAUsage query={query} />
|
||||
) : (
|
||||
@@ -492,6 +517,30 @@ export function QAOperations() {
|
||||
detail={detail}
|
||||
detailLoading={detailLoading}
|
||||
detailError={detailError}
|
||||
onReloadDetail={() => {
|
||||
if (detail) void select(detail.id)
|
||||
}}
|
||||
onQualitySaved={(fresh) => {
|
||||
if (fresh.id !== detail?.id) return
|
||||
setDetail(fresh)
|
||||
setPage((old) => {
|
||||
if (!old) return old
|
||||
const all = new Set(old.columns)
|
||||
const f = fresh.quality?.effective
|
||||
if (f) {
|
||||
if (f.coverage) all.add('coverage')
|
||||
if (f.correctness) all.add('is_correct')
|
||||
for (const key of ['product_category', 'problem_type', 'root_cause'] as const)
|
||||
if (f[key]) all.add(key)
|
||||
}
|
||||
return {
|
||||
...old,
|
||||
items: old.items.map((item) => (item.id === fresh.id ? fresh : item)),
|
||||
columns: qaColumns.filter((c) => all.has(c.key)).map((c) => c.key),
|
||||
}
|
||||
})
|
||||
setQualityRevision((v) => v + 1)
|
||||
}}
|
||||
onSelect={(id) => void select(id)}
|
||||
onCloseDetail={close}
|
||||
onLoadMore={() => void loadMore()}
|
||||
|
||||
Reference in New Issue
Block a user