fix(mobile): complete SOP focus regression
This commit is contained in:
@@ -237,7 +237,7 @@ import {
|
||||
submitAnswerFeedback
|
||||
} from '@/services/knowledge';
|
||||
import { getSelectedPosition, getSelectedPositionProfile, isLoggedIn, rememberLoginRedirect } from '@/services/auth';
|
||||
import { scrollPageToSelector } from '@/services/navigation';
|
||||
import { resetPageScroll, scrollPageToSelector } from '@/services/navigation';
|
||||
import { ensureEmployeePosition } from '@/services/position';
|
||||
|
||||
const positionProfile = ref(getSelectedPositionProfile());
|
||||
|
||||
@@ -327,8 +327,9 @@ function identitySuffix(value: string) {
|
||||
|
||||
function trainingTrendLabel(value: string, index: number) {
|
||||
const parts = value.match(/\d+/g) || [];
|
||||
if (parts.length >= 3 && parts[0].length === 4) return `${parts[1].padStart(2, '0')}-${parts[2].padStart(2, '0')}`;
|
||||
if (parts.length >= 2) return `${parts[0].padStart(2, '0')}-${parts[1].padStart(2, '0')}`;
|
||||
const [first = '', second = '', third = ''] = parts;
|
||||
if (parts.length >= 3 && first.length === 4) return `${second.padStart(2, '0')}-${third.padStart(2, '0')}`;
|
||||
if (parts.length >= 2) return `${first.padStart(2, '0')}-${second.padStart(2, '0')}`;
|
||||
return `第${index + 1}次`;
|
||||
}
|
||||
|
||||
@@ -339,6 +340,6 @@ function practiceTimeValue(value: string) {
|
||||
}
|
||||
const normalized = parts.length >= 5 ? parts.slice(0, 6) : [0, ...parts.slice(0, 5)];
|
||||
while (normalized.length < 6) normalized.push(0);
|
||||
const [year, month, day, hour, minute, second] = normalized;
|
||||
const [year = 0, month = 0, day = 0, hour = 0, minute = 0, second = 0] = normalized;
|
||||
return (((((year * 13 + month) * 32 + day) * 24 + hour) * 60 + minute) * 60) + second;
|
||||
}
|
||||
|
||||
@@ -185,9 +185,9 @@ export interface PracticeTurnResponse {
|
||||
}
|
||||
|
||||
export interface PracticeDimensionScore {
|
||||
name: string;
|
||||
score: number;
|
||||
comment?: string;
|
||||
label: string;
|
||||
value: number | string;
|
||||
note?: string;
|
||||
}
|
||||
|
||||
export interface PracticeFinishResponse {
|
||||
|
||||
@@ -45,6 +45,7 @@ test('训练结果回到顶部,SOP 答案生成后定位到回答区', async (
|
||||
]);
|
||||
|
||||
assert.match(practiceSource, /result\.value = await finishPractice\([\s\S]*?resetPageScroll\(\)/);
|
||||
assert.match(sopSource, /import \{ resetPageScroll, scrollPageToSelector \} from '@\/services\/navigation';/);
|
||||
assert.match(sopSource, /result\.value = await searchKnowledge\(value\);\s*scrollPageToSelector\('\.answer-panel'/);
|
||||
assert.match(navigationSource, /export const scrollPageToSelector = \(selector: string/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user