|
@@ -51,14 +51,22 @@ watch(() => store.projectInfo, (val) => {
|
|
|
})
|
|
|
|
|
|
//渲染完成
|
|
|
-onMounted(() => {
|
|
|
- getProjectData()
|
|
|
+const pageSource = ref('')
|
|
|
+const isImportPath = ref('')
|
|
|
+onMounted(async () => {
|
|
|
+ await getProjectData()
|
|
|
+ //判断是否有导入项目
|
|
|
+ const { path, source } = getObjValue(useRoutes.query)
|
|
|
+ console.log('导入项目:', path)
|
|
|
+ if (!isNullES(path) || isImportPath.value !== path) {
|
|
|
+ setImportProject(path)
|
|
|
+ isImportPath.value = path
|
|
|
+ }
|
|
|
+ pageSource.value = source
|
|
|
})
|
|
|
|
|
|
//获取项目信息
|
|
|
const projectData = ref([])
|
|
|
-const pageSource = ref('')
|
|
|
-const isImportPath = ref('')
|
|
|
const getProjectData = async () => {
|
|
|
projectData.value = []
|
|
|
loadingText.value = '获取项目信息中...'
|
|
@@ -66,14 +74,6 @@ const getProjectData = async () => {
|
|
|
const { data } = await getProjectInfo()
|
|
|
projectData.value = getArrValue(data)
|
|
|
isLoading.value = false
|
|
|
- //判断是否有导入项目
|
|
|
- const { path, source } = getObjValue(useRoutes.query)
|
|
|
- console.log('导入项目:', path)
|
|
|
- if (!isNullES(path) || isImportPath.value !== path) {
|
|
|
- setImportProject(path)
|
|
|
- isImportPath.value = path
|
|
|
- }
|
|
|
- pageSource.value = source
|
|
|
}
|
|
|
|
|
|
//导入项目
|