fix(aihr): load real practice records first
This commit is contained in:
@@ -225,3 +225,4 @@
|
|||||||
- 2026-07-14 BRD 6.3 提示词模板回退语义复核:模型配置页的提示词模板接口失败时原先直接显示空列表,无法区分真实无模板与接口不可用;现增加持久的“当前列表不代表真实租户模板数据”提示,接口恢复后自动消失。该修复不创建默认模板,也不改变模板写入权限。
|
- 2026-07-14 BRD 6.3 提示词模板回退语义复核:模型配置页的提示词模板接口失败时原先直接显示空列表,无法区分真实无模板与接口不可用;现增加持久的“当前列表不代表真实租户模板数据”提示,接口恢复后自动消失。该修复不创建默认模板,也不改变模板写入权限。
|
||||||
- 2026-07-14 BRD 6.3 AI 面试记录回退语义复核:面试记录接口成功返回空列表时原先会错误替换为内置历史记录,接口失败时也只静默回退;现保留真实空列表,仅失败时展示演示记录并增加持久提示“当前显示演示记录,不代表真实面试数据”。该修复不改变面试题生成、评分或复核流程。
|
- 2026-07-14 BRD 6.3 AI 面试记录回退语义复核:面试记录接口成功返回空列表时原先会错误替换为内置历史记录,接口失败时也只静默回退;现保留真实空列表,仅失败时展示演示记录并增加持久提示“当前显示演示记录,不代表真实面试数据”。该修复不改变面试题生成、评分或复核流程。
|
||||||
- 2026-07-14 BRD 6.3 复盘与 SOP 数据来源复核:复盘页在试点指标接口失败时原先用待复盘记录数代替校准样本数,现改为显示未知并持久提示接口不可用;SOP 文档表继续保留断网演示样例,但为内置演示/已上传记录增加来源标识和提示,避免把演示文档或列表数量误当真实库覆盖与 M5 指标。
|
- 2026-07-14 BRD 6.3 复盘与 SOP 数据来源复核:复盘页在试点指标接口失败时原先用待复盘记录数代替校准样本数,现改为显示未知并持久提示接口不可用;SOP 文档表继续保留断网演示样例,但为内置演示/已上传记录增加来源标识和提示,避免把演示文档或列表数量误当真实库覆盖与 M5 指标。
|
||||||
|
- 2026-07-14 BRD 6.3 对练记录回退语义复核:管理端三角色对练页原先始终显示三条静态最近记录,未请求真实复盘记录;现改为 API 优先,真实空列表保持为空,只有接口失败才显示演示记录并持续提示。当前会话完成后追加到现有列表,不再重置时覆盖历史记录。
|
||||||
|
|||||||
@@ -24,6 +24,15 @@
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<el-alert
|
||||||
|
v-if="recordsFallback"
|
||||||
|
class="data-warning"
|
||||||
|
type="warning"
|
||||||
|
:closable="false"
|
||||||
|
show-icon
|
||||||
|
title="训练记录接口暂不可用,当前显示演示记录,不代表真实训练数据。"
|
||||||
|
/>
|
||||||
|
|
||||||
<section class="flow-strip">
|
<section class="flow-strip">
|
||||||
<div v-for="step in flowSteps" :key="step.title" class="flow-step" :class="{ active: step.active, done: step.done }">
|
<div v-for="step in flowSteps" :key="step.title" class="flow-step" :class="{ active: step.active, done: step.done }">
|
||||||
<span>{{ step.index }}</span>
|
<span>{{ step.index }}</span>
|
||||||
@@ -322,6 +331,7 @@ import {
|
|||||||
type PracticePrepCardResponse,
|
type PracticePrepCardResponse,
|
||||||
type PracticeScenarioResponse
|
type PracticeScenarioResponse
|
||||||
} from '@/api/aihr/practice';
|
} from '@/api/aihr/practice';
|
||||||
|
import { listPracticeReviews } from '@/api/aihr/mobile-admin';
|
||||||
import { searchKnowledgeSop, type SopSearchResponse } from '@/api/aihr/sop';
|
import { searchKnowledgeSop, type SopSearchResponse } from '@/api/aihr/sop';
|
||||||
import { resolvePilotDateWindow } from './pilot-export';
|
import { resolvePilotDateWindow } from './pilot-export';
|
||||||
|
|
||||||
@@ -476,6 +486,7 @@ const sopHelpLoading = ref(false);
|
|||||||
const sopHelpMessage = ref('');
|
const sopHelpMessage = ref('');
|
||||||
const conversation = ref<ChatTurn[]>([]);
|
const conversation = ref<ChatTurn[]>([]);
|
||||||
const records = ref([...baseRecords]);
|
const records = ref([...baseRecords]);
|
||||||
|
const recordsFallback = ref(true);
|
||||||
const promptTemplates = ref<PromptTemplateResponse[]>([]);
|
const promptTemplates = ref<PromptTemplateResponse[]>([]);
|
||||||
const promptLoading = ref(false);
|
const promptLoading = ref(false);
|
||||||
const promptSaving = ref(false);
|
const promptSaving = ref(false);
|
||||||
@@ -643,6 +654,24 @@ const loadScenarioOptions = async () => {
|
|||||||
await loadPrepCard();
|
await loadPrepCard();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const loadRecentRecords = async () => {
|
||||||
|
try {
|
||||||
|
const { data } = await listPracticeReviews({ limit: 10 });
|
||||||
|
records.value = (data || []).map((item) => ({
|
||||||
|
time: item.time,
|
||||||
|
trainee: item.trainee,
|
||||||
|
scene: item.scene,
|
||||||
|
score: item.score,
|
||||||
|
status: item.status,
|
||||||
|
summary: item.summary
|
||||||
|
}));
|
||||||
|
recordsFallback.value = false;
|
||||||
|
} catch {
|
||||||
|
records.value = [...baseRecords];
|
||||||
|
recordsFallback.value = true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const appendTurn = (role: ChatRole, text: string) => {
|
const appendTurn = (role: ChatRole, text: string) => {
|
||||||
const nameMap = { customer: 'AI 业主', trainee: '学员', coach: 'AI 教练' };
|
const nameMap = { customer: 'AI 业主', trainee: '学员', coach: 'AI 教练' };
|
||||||
conversation.value.push({ id: `${role}-${conversation.value.length}`, role, name: nameMap[role], text });
|
conversation.value.push({ id: `${role}-${conversation.value.length}`, role, name: nameMap[role], text });
|
||||||
@@ -669,7 +698,6 @@ const resetPractice = () => {
|
|||||||
calibrationReason.value = '管理端人工校准';
|
calibrationReason.value = '管理端人工校准';
|
||||||
calibrationMessage.value = '';
|
calibrationMessage.value = '';
|
||||||
conversation.value = [];
|
conversation.value = [];
|
||||||
records.value = [...baseRecords];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleScenarioChange = () => {
|
const handleScenarioChange = () => {
|
||||||
@@ -805,7 +833,7 @@ const finishScore = async () => {
|
|||||||
|
|
||||||
scored.value = true;
|
scored.value = true;
|
||||||
calibrationScore.value = Math.max(0, Math.min(100, Math.round(Number(displayTotal.value) || 0)));
|
calibrationScore.value = Math.max(0, Math.min(100, Math.round(Number(displayTotal.value) || 0)));
|
||||||
records.value = [nextRecord, ...baseRecords];
|
records.value = [nextRecord, ...records.value];
|
||||||
if (apiMode.value !== 'api') {
|
if (apiMode.value !== 'api') {
|
||||||
ElMessage.success('考官评分已生成,并写入本地对练记录');
|
ElMessage.success('考官评分已生成,并写入本地对练记录');
|
||||||
}
|
}
|
||||||
@@ -970,6 +998,7 @@ const togglePromptTemplate = async (template: PromptTemplateResponse) => {
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
void loadScenarioOptions();
|
void loadScenarioOptions();
|
||||||
void loadPromptTemplates();
|
void loadPromptTemplates();
|
||||||
|
void loadRecentRecords();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -455,6 +455,8 @@ contains frontend/src/views/train/practice.vue "训练前预习卡"
|
|||||||
contains frontend/src/views/train/practice.vue "Rubric 预览"
|
contains frontend/src/views/train/practice.vue "Rubric 预览"
|
||||||
contains frontend/src/views/train/practice.vue "提示词模板"
|
contains frontend/src/views/train/practice.vue "提示词模板"
|
||||||
contains frontend/src/views/train/practice.vue "导出试点CSV"
|
contains frontend/src/views/train/practice.vue "导出试点CSV"
|
||||||
|
contains frontend/src/views/train/practice.vue "训练记录接口暂不可用,当前显示演示记录"
|
||||||
|
contains frontend/src/views/train/practice.vue "listPracticeReviews"
|
||||||
contains frontend/src/views/train/reviews.vue "导出试点 CSV"
|
contains frontend/src/views/train/reviews.vue "导出试点 CSV"
|
||||||
contains frontend/src/views/train/reviews.vue "人工校准总分"
|
contains frontend/src/views/train/reviews.vue "人工校准总分"
|
||||||
contains frontend/src/views/train/reviews.vue "不展示演示复盘记录或猜测性试点指标"
|
contains frontend/src/views/train/reviews.vue "不展示演示复盘记录或猜测性试点指标"
|
||||||
|
|||||||
Reference in New Issue
Block a user