Add D3.js dependency and implement pending upload state management
- Added D3.js as a dependency in `package.json` and `package-lock.json` for data visualization capabilities. - Introduced a new `pendingUpload.js` store to manage files and simulation requirements before initiating the simulation process. - Updated `Home.vue` to store pending uploads and navigate to the `Process` page immediately, deferring API calls for improved user experience. - Enhanced `Process.vue` to handle new project initialization and display project status effectively, including progress tracking for ontology generation and graph building.
This commit is contained in:
33
frontend/src/store/pendingUpload.js
Normal file
33
frontend/src/store/pendingUpload.js
Normal file
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* 临时存储待上传的文件和需求
|
||||
* 用于首页点击启动引擎后立即跳转,在Process页面再进行API调用
|
||||
*/
|
||||
import { reactive } from 'vue'
|
||||
|
||||
const state = reactive({
|
||||
files: [],
|
||||
simulationRequirement: '',
|
||||
isPending: false
|
||||
})
|
||||
|
||||
export function setPendingUpload(files, requirement) {
|
||||
state.files = files
|
||||
state.simulationRequirement = requirement
|
||||
state.isPending = true
|
||||
}
|
||||
|
||||
export function getPendingUpload() {
|
||||
return {
|
||||
files: state.files,
|
||||
simulationRequirement: state.simulationRequirement,
|
||||
isPending: state.isPending
|
||||
}
|
||||
}
|
||||
|
||||
export function clearPendingUpload() {
|
||||
state.files = []
|
||||
state.simulationRequirement = ''
|
||||
state.isPending = false
|
||||
}
|
||||
|
||||
export default state
|
||||
Reference in New Issue
Block a user