fix: classification results empty and res.data access issues
Backend: - Add GET /classifications/results endpoint with project/level/keyword filters - Add column relationship to ClassificationResult model - Fix test data generator to fetch column IDs from DB after bulk insert Frontend: - Fix request.ts interceptor to return full response body (keep total/pagination) - Fix all pages to use res.data instead of res - Add getClassificationResults API in classification.ts - Implement fetchData in Classification.vue with proper filtering and pagination - Fix same res.data issue in Category.vue, Metadata.vue, Project.vue, DataSource.vue, Dashboard.vue, Task.vue
This commit is contained in:
@@ -76,3 +76,34 @@ export function deleteRule(id: number) {
|
||||
export function getTemplates() {
|
||||
return request.get('/classifications/templates')
|
||||
}
|
||||
|
||||
export interface ClassificationResultItem {
|
||||
id: number
|
||||
project_id: number
|
||||
column_id?: number
|
||||
column_name?: string
|
||||
data_type?: string
|
||||
comment?: string
|
||||
table_name?: string
|
||||
database_name?: string
|
||||
source_name?: string
|
||||
category_id?: number
|
||||
category_name?: string
|
||||
level_id?: number
|
||||
level_name?: string
|
||||
level_color?: string
|
||||
source: string
|
||||
confidence: number
|
||||
status: string
|
||||
created_at?: string
|
||||
}
|
||||
|
||||
export function getClassificationResults(params: {
|
||||
project_id?: number
|
||||
level_id?: number
|
||||
keyword?: string
|
||||
page?: number
|
||||
page_size?: number
|
||||
}) {
|
||||
return request.get('/classifications/results', { params })
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ request.interceptors.response.use(
|
||||
ElMessage.error(res.message || '请求失败')
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
return res.data
|
||||
return res
|
||||
},
|
||||
(error: AxiosError) => {
|
||||
const status = error.response?.status
|
||||
|
||||
Reference in New Issue
Block a user