feat(web): Ontology support import & export;
docs(web): add comments to the src/views/Ontology directory
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
/*
|
||||
* @Author: ZhaoYing
|
||||
* @Date: 2026-02-03 13:59:12
|
||||
* @Last Modified by: ZhaoYing
|
||||
* @Last Modified time: 2026-02-03 13:59:12
|
||||
*/
|
||||
import { request } from '@/utils/request'
|
||||
import type { Query, OntologyModalData, OntologyClassModalData, OntologyClassExtractModalData } from '@/views/Ontology/types'
|
||||
import type { Query, OntologyModalData, OntologyClassModalData, OntologyClassExtractModalData, OntologyExportModalData } from '@/views/Ontology/types'
|
||||
|
||||
// Scene list
|
||||
export const getOntologyScenesUrl = '/memory/ontology/scenes'
|
||||
@@ -37,3 +43,11 @@ export const createOntologyClass = (data: OntologyClassModalData) => {
|
||||
export const deleteOntologyClass = (class_id: string) => {
|
||||
return request.delete(`/memory/ontology/class/${class_id}`)
|
||||
}
|
||||
// Import scenario
|
||||
export const ontologyImport = (data: unknown) => {
|
||||
return request.uploadFile('/memory/ontology/import', data)
|
||||
}
|
||||
// Export scenario
|
||||
export const ontologyExport = (data: OntologyExportModalData, fileName: string, callback: () => void) => {
|
||||
return request.downloadFile('/memory/ontology/export', fileName, data, callback)
|
||||
}
|
||||
Reference in New Issue
Block a user