修改
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -67,3 +67,6 @@ doc/test-data/**/~$*
|
||||
db_config.conf
|
||||
|
||||
~*.*
|
||||
|
||||
|
||||
./.playwright-cli
|
||||
|
||||
@@ -60,6 +60,7 @@ import ParamConfig from "./components/detail/ParamConfig";
|
||||
import PreliminaryCheck from "./components/detail/PreliminaryCheck";
|
||||
import SpecialCheck from "./components/detail/SpecialCheck";
|
||||
import DetailQuery from "./components/detail/DetailQuery";
|
||||
import {getProject} from "@/api/ccdiProject";
|
||||
|
||||
export default {
|
||||
name: "ProjectDetail",
|
||||
@@ -111,7 +112,43 @@ export default {
|
||||
/** 初始化页面数据 */
|
||||
initPageData() {
|
||||
// 这里应该从API获取项目详细信息
|
||||
this.mockProjectInfo();
|
||||
if (!this.projectId) {
|
||||
return;
|
||||
}
|
||||
this.projectInfo.projectName = "";
|
||||
this.updatePageTitle();
|
||||
getProject(this.projectId)
|
||||
.then((res) => {
|
||||
const data = res.data || {};
|
||||
this.projectInfo = {
|
||||
...this.projectInfo,
|
||||
...data,
|
||||
projectId: data.projectId || this.projectId,
|
||||
projectName: data.projectName || "",
|
||||
projectDesc: data.projectDesc || data.description || "",
|
||||
projectStatus: String(
|
||||
data.projectStatus !== undefined && data.projectStatus !== null
|
||||
? data.projectStatus
|
||||
: data.status !== undefined && data.status !== null
|
||||
? data.status
|
||||
: this.projectInfo.projectStatus
|
||||
),
|
||||
};
|
||||
this.updatePageTitle();
|
||||
})
|
||||
.catch(() => {
|
||||
this.$message.error("Failed to load project details");
|
||||
this.updatePageTitle();
|
||||
});
|
||||
},
|
||||
updatePageTitle() {
|
||||
const title = this.projectInfo.projectName || `ProjectDetail-${this.projectId}`;
|
||||
this.$route.meta.title = title;
|
||||
this.$store.dispatch("settings/setTitle", title);
|
||||
this.$store.dispatch("tagsView/updateVisitedView", {
|
||||
path: this.$route.path,
|
||||
title,
|
||||
});
|
||||
},
|
||||
/** 格式化更新时间 */
|
||||
formatUpdateTime(time) {
|
||||
@@ -217,7 +254,7 @@ export default {
|
||||
},
|
||||
/** 刷新页面 */
|
||||
handleRefresh() {
|
||||
this.mockProjectInfo();
|
||||
this.initPageData();
|
||||
this.$message.success("刷新成功");
|
||||
},
|
||||
/** 导出报告 */
|
||||
|
||||
Reference in New Issue
Block a user