详情使用共享主表字典,稀疏修改所选字段并保留原始问答及旧复核审计。 月周统计提供文本和下拉双入口;每租户每周一份持久草稿,按技能六节双语模板真实预填。 加入幂等自动保存、冲突保留、未知响应重试、切周及离开保护和schema58非破坏降级保护。 验证:完整make verify、隔离PostgreSQL全mirror竞态回归、真实恢复库浏览器验收通过。 浏览器实测字段精确读回、月周双输入、模板预填、MD/CSV、自动保存、冲突、失败重试与API重启恢复。 未连接或改写DobotAI生产源库,未运行付费模型;提交时尚未部署。
This commit is contained in:
+18
-1
@@ -84,6 +84,7 @@ export function mergeQAPages(current: QARecordPage, next: QARecordPage): QARecor
|
||||
}
|
||||
}
|
||||
export interface QARecord {
|
||||
field_edit_revision?: number
|
||||
background_tasks?: AIWorkState[]
|
||||
record_origin?: 'dobotai_2_0' | 'historical_excel'
|
||||
master_fields?: Partial<Record<QAColumn, string>>
|
||||
@@ -215,6 +216,7 @@ export function parseQARecord(value: unknown): QARecord {
|
||||
if (typeof row.is_correct !== 'boolean' && row.is_correct !== null) return invalid()
|
||||
item.is_correct = row.is_correct
|
||||
}
|
||||
if (row.field_edit_revision !== undefined) item.field_edit_revision = count(row.field_edit_revision)
|
||||
if (row.record_origin !== undefined) {
|
||||
if (row.record_origin !== 'dobotai_2_0' && row.record_origin !== 'historical_excel') return invalid()
|
||||
item.record_origin = row.record_origin
|
||||
@@ -291,6 +293,16 @@ export function parseQARecordPage(value: unknown): QARecordPage {
|
||||
}
|
||||
}
|
||||
|
||||
export class QARequestError extends Error {
|
||||
constructor(
|
||||
message: string,
|
||||
public readonly status: number
|
||||
) {
|
||||
super(message)
|
||||
this.name = 'QARequestError'
|
||||
}
|
||||
}
|
||||
|
||||
export async function getPayload(
|
||||
path: string,
|
||||
signal?: AbortSignal,
|
||||
@@ -300,7 +312,10 @@ export async function getPayload(
|
||||
const raw: unknown = await response.json().catch(() => null)
|
||||
if (!response.ok) {
|
||||
const payload = raw && typeof raw === 'object' ? (raw as Record<string, unknown>) : null
|
||||
throw new Error(typeof payload?.error === 'string' ? payload.error : `问答数据读取失败(HTTP ${response.status})`)
|
||||
throw new QARequestError(
|
||||
typeof payload?.error === 'string' ? payload.error : `问答数据读取失败(HTTP ${response.status})`,
|
||||
response.status
|
||||
)
|
||||
}
|
||||
return object(raw).data
|
||||
}
|
||||
@@ -399,6 +414,8 @@ const qaAskedAtFormatter = new Intl.DateTimeFormat('zh-CN', {
|
||||
})
|
||||
|
||||
export function qaCellValue(item: QARecord, column: QAColumn): string | null {
|
||||
if (column === 'root_cause' && item.field_edit_revision && item.quality?.effective.correctness === 'correct')
|
||||
return null
|
||||
if (column === 'trigger_person') return triggerPersonName(item.master_fields?.trigger_person ?? item.trigger_person)
|
||||
|
||||
const reviewedQuality =
|
||||
|
||||
Reference in New Issue
Block a user