yeg
2026-09-05 4142add66fd7ae6a12f2703d94f106a0c58d1204
对齐数据删除交互语义
2个文件已修改
6 ■■■■■ 已修改文件
src/api/consoleData.ts 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/ConsoleDataListPanel.vue 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/consoleData.ts
@@ -21,7 +21,7 @@
  identitySummary: string
  changesSummary: string | null
  reason: string
  overrides: Array<{
  overrides?: Array<{
    stableIdentity: string
    fieldValues: string | null
    deleted: boolean
src/components/ConsoleDataListPanel.vue
@@ -323,12 +323,12 @@
  const physicalIds = ids
  let result: { value: string }
  try {
    result = await ElMessageBox.prompt(`确认从当前有效视图移除 ${ids.length} 条${activeTab.value}数据?原始设备数据仍会保留。`, '移除数据', { inputPlaceholder: '请输入移除原因', inputValidator: value => (value.trim() ? true : '移除原因不能为空') })
    result = await ElMessageBox.prompt(`确认物理删除 ${ids.length} 条${activeTab.value}数据?删除前内容会写入数据修订记录。`, '物理删除数据', { inputPlaceholder: '请输入删除原因', inputValidator: value => (value.trim() ? true : '删除原因不能为空') })
  } catch {
    return
  }
  try {
    await submitConsoleDataAction(props.testId, { dataType: dataType.value, operationType: 'DELETE', scopeSummary: `从当前有效视图移除${ids.length}条${activeTab.value}数据`, identitySummary: JSON.stringify(physicalIds), changesSummary: null, reason: result.value.trim(), overrides: physicalIds.map(stableIdentity => ({ stableIdentity, fieldValues: null, deleted: true })) })
    await submitConsoleDataAction(props.testId, { dataType: dataType.value, operationType: 'DELETE', scopeSummary: `物理删除${ids.length}条${activeTab.value}数据`, identitySummary: JSON.stringify(physicalIds), changesSummary: null, reason: result.value.trim() })
    if (activeTab.value === 'realtime') rows.value = rows.value.filter(row => !ids.includes(row.id))
    else if (activeTab.value === 'step') stepRows.value = stepRows.value.filter(row => !physicalIds.includes(row.id))
    else cycleRows.value = cycleRows.value.filter(row => !ids.includes(row.id))