fix(aihr): hide demo records during initial load
This commit is contained in:
@@ -199,7 +199,7 @@
|
||||
<el-icon><Tickets /></el-icon>
|
||||
<h2>最近对练记录</h2>
|
||||
</div>
|
||||
<el-table :data="records" size="small" class="record-table">
|
||||
<el-table v-loading="recordsLoading" :data="records" size="small" class="record-table">
|
||||
<el-table-column prop="time" label="时间" width="128" />
|
||||
<el-table-column prop="trainee" label="学员" width="120" />
|
||||
<el-table-column prop="scene" label="场景" min-width="150" />
|
||||
@@ -485,8 +485,9 @@ const sopHelp = ref<SopSearchResponse | null>(null);
|
||||
const sopHelpLoading = ref(false);
|
||||
const sopHelpMessage = ref('');
|
||||
const conversation = ref<ChatTurn[]>([]);
|
||||
const records = ref([...baseRecords]);
|
||||
const recordsFallback = ref(true);
|
||||
const records = ref<Array<(typeof baseRecords)[number]>>([]);
|
||||
const recordsLoading = ref(true);
|
||||
const recordsFallback = ref(false);
|
||||
const promptTemplates = ref<PromptTemplateResponse[]>([]);
|
||||
const promptLoading = ref(false);
|
||||
const promptSaving = ref(false);
|
||||
@@ -655,6 +656,7 @@ const loadScenarioOptions = async () => {
|
||||
};
|
||||
|
||||
const loadRecentRecords = async () => {
|
||||
recordsLoading.value = true;
|
||||
try {
|
||||
const { data } = await listPracticeReviews({ limit: 10 });
|
||||
records.value = (data || []).map((item) => ({
|
||||
@@ -669,6 +671,8 @@ const loadRecentRecords = async () => {
|
||||
} catch {
|
||||
records.value = [...baseRecords];
|
||||
recordsFallback.value = true;
|
||||
} finally {
|
||||
recordsLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user