fix: resolve TypeScript compilation errors
Fixes: - VideoPlayer.vue: restore allTags, filteredMarks, marksByTag (removed by mistake) - PeopleView.vue: fix frameTime scope in playFaceDetailVideo catch block - Both errors caused white screen on build failure Root cause: 1. visibleTags duplicate declaration (old + new logic) 2. frameTime undefined in catch block (scope issue) Solution: 1. Keep allTags/filteredMarks/marksByTag (needed in template) 2. Keep visibleTags (new logic for processor toggles) 3. Move frameTime calculation to correct scope in catch block
This commit is contained in:
33
src/api/params.ts
Normal file
33
src/api/params.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
export const PARAM_MAP: Record<string, string> = {
|
||||
pageSize: 'page_size',
|
||||
perPage: 'per_page',
|
||||
fileUuid: 'file_uuid',
|
||||
startTime: 'start_time',
|
||||
endTime: 'end_time',
|
||||
startFrame: 'start_frame',
|
||||
endFrame: 'end_frame',
|
||||
bboxX: 'bbox_x',
|
||||
bboxY: 'bbox_y',
|
||||
bboxW: 'bbox_w',
|
||||
bboxH: 'bbox_h',
|
||||
conversationId: 'conversation_id',
|
||||
historyId: 'history_id',
|
||||
mergeId: 'merge_id',
|
||||
traceId: 'trace_id',
|
||||
faceId: 'face_id',
|
||||
}
|
||||
|
||||
export function toSnakeCase(key: string): string {
|
||||
if (PARAM_MAP[key]) return PARAM_MAP[key]
|
||||
return key.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`)
|
||||
}
|
||||
|
||||
export function mapParams(params: Record<string, any>): Record<string, any> {
|
||||
const result: Record<string, any> = {}
|
||||
for (const [key, value] of Object.entries(params)) {
|
||||
if (value !== undefined && value !== null) {
|
||||
result[toSnakeCase(key)] = value
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
26
src/api/types.ts
Normal file
26
src/api/types.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
export interface PoseKeypoint {
|
||||
name: string
|
||||
x: number
|
||||
y: number
|
||||
confidence?: number
|
||||
}
|
||||
|
||||
export type PoseClass = 'standing' | 'sitting' | 'kneeling' | 'lying' | 'prone' | 'unknown'
|
||||
|
||||
export interface PoseResponse {
|
||||
frame: number
|
||||
keypoints: PoseKeypoint[]
|
||||
pose_class: PoseClass
|
||||
confidence?: number
|
||||
}
|
||||
|
||||
export interface DominantColor {
|
||||
rgb: [number, number, number]
|
||||
percentage?: number
|
||||
}
|
||||
|
||||
export interface AppearanceResponse {
|
||||
frame: number
|
||||
dominant_colors: DominantColor[]
|
||||
hsv_histogram?: number[][][]
|
||||
}
|
||||
Reference in New Issue
Block a user