详情使用共享主表字典,稀疏修改所选字段并保留原始问答及旧复核审计。 月周统计提供文本和下拉双入口;每租户每周一份持久草稿,按技能六节双语模板真实预填。 加入幂等自动保存、冲突保留、未知响应重试、切周及离开保护和schema58非破坏降级保护。 验证:完整make verify、隔离PostgreSQL全mirror竞态回归、真实恢复库浏览器验收通过。 浏览器实测字段精确读回、月周双输入、模板预填、MD/CSV、自动保存、冲突、失败重试与API重启恢复。 未连接或改写DobotAI生产源库,未运行付费模型;提交时尚未部署。
This commit is contained in:
+22
-35
@@ -8,7 +8,7 @@ import { ledgerWindow, ledgerCellPreview } from './qaLedgerRendering'
|
||||
import { QARegionalStatistics } from './QADepartmentStatistics'
|
||||
import { QADashboard } from './QADashboard'
|
||||
import { QAWeekly } from './QAWeekly'
|
||||
import { QAQualityEditor } from './QAQuality'
|
||||
import { QAInlineFields } from './QAInlineFields'
|
||||
import { qaFieldColors, qaTagColumns } from './qaFieldColors'
|
||||
import { qualityLabels } from './qaQuality'
|
||||
import { QAWeekPicker } from './QAWeekPicker'
|
||||
@@ -272,16 +272,12 @@ export function QAOperationsView(props: ViewProps) {
|
||||
</button>
|
||||
</header>
|
||||
{detail ? (
|
||||
<div className="qa-detail-quality" aria-label="固定质量字段">
|
||||
{(['coverage', 'is_correct', 'product_category', 'problem_type', 'root_cause'] as const).map((key) => (
|
||||
<div key={key} data-quality-field={key}>
|
||||
<span>{qaColumns.find((column) => column.key === key)!.label}</span>
|
||||
<strong className="qa-field-tag" style={qaFieldColors(key, qaCellValue(detail, key) ?? '—')}>
|
||||
{qaCellValue(detail, key) ?? '—'}
|
||||
</strong>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
<QAInlineFields
|
||||
key={detail.id}
|
||||
record={detail}
|
||||
onSaved={props.onQualitySaved ?? (() => {})}
|
||||
onReload={props.onReloadDetail ?? (() => {})}
|
||||
/>
|
||||
) : null}
|
||||
{props.detailLoading ? <p role="status">正在读取完整问答…</p> : null}
|
||||
{props.detailError ? (
|
||||
@@ -334,28 +330,6 @@ export function QAOperationsView(props: ViewProps) {
|
||||
?.map((task) => task.updated_at)
|
||||
.join(':')}
|
||||
/>
|
||||
{detail.quality ? (
|
||||
<QAQualityEditor
|
||||
key={detail.id}
|
||||
recordId={detail.id}
|
||||
dataset={detail.record_origin ? 'master' : undefined}
|
||||
quality={detail.quality}
|
||||
onSaved={props.onQualitySaved ?? (() => {})}
|
||||
onReload={props.onReloadDetail ?? (() => {})}
|
||||
/>
|
||||
) : (
|
||||
<p className="qa-ops-muted">质量留档/人工复核未配置。</p>
|
||||
)}
|
||||
<h4>用户反馈</h4>
|
||||
<p>
|
||||
提问人:
|
||||
{detail.feedback.asker_value === 'up'
|
||||
? '点赞'
|
||||
: detail.feedback.asker_value === 'down'
|
||||
? '点踩'
|
||||
: '无反馈'}
|
||||
;全部反馈:赞 {detail.feedback.up} / 踩 {detail.feedback.down}
|
||||
</p>
|
||||
<h4>引用知识</h4>
|
||||
<pre>{JSON.stringify(detail.references, null, 2)}</pre>
|
||||
<details>
|
||||
@@ -379,6 +353,10 @@ function initialDraft() {
|
||||
|
||||
export function QAOperations() {
|
||||
const [view, setView] = useState<QAOpsView>('records')
|
||||
const weeklyBeforeLeave = useRef<(() => Promise<boolean>) | null>(null)
|
||||
const registerWeeklyLeave = useCallback((guard: (() => Promise<boolean>) | null) => {
|
||||
weeklyBeforeLeave.current = guard
|
||||
}, [])
|
||||
const auth = useOptionalAuth()
|
||||
const canRead = auth?.identity?.role === 'admin'
|
||||
const [draft, setDraft] = useState(initialDraft)
|
||||
@@ -528,7 +506,16 @@ export function QAOperations() {
|
||||
</p>
|
||||
) : (
|
||||
<>
|
||||
<QAOperationsTabs view={view} onChange={setView} />
|
||||
<QAOperationsTabs
|
||||
view={view}
|
||||
onChange={(next) => {
|
||||
if (view === 'weekly' && next !== 'weekly' && weeklyBeforeLeave.current)
|
||||
void weeklyBeforeLeave.current().then((ok) => {
|
||||
if (ok) setView(next)
|
||||
})
|
||||
else setView(next)
|
||||
}}
|
||||
/>
|
||||
{queryView ? (
|
||||
<>
|
||||
{mirrorChanged ? <p className="qa-ops-warning">数据已更新,关闭详情后刷新。</p> : null}
|
||||
@@ -608,7 +595,7 @@ export function QAOperations() {
|
||||
}}
|
||||
/>
|
||||
) : view === 'weekly' ? (
|
||||
<QAWeekly query={query} />
|
||||
<QAWeekly onBeforeLeave={registerWeeklyLeave} />
|
||||
) : view === 'dashboard' ? (
|
||||
<QADashboard
|
||||
query={query}
|
||||
|
||||
Reference in New Issue
Block a user