信息架构/菜单框架大重构-20260109
This commit is contained in:
+242
-124
@@ -5,27 +5,8 @@ import Layout from "../components/Layout.vue";
|
||||
import Login from "../views/Login.vue";
|
||||
import Register from "../views/Register.vue";
|
||||
import StudyHome from "../views/StudyHome.vue";
|
||||
import Milestones from "../views/Milestones.vue";
|
||||
import MilestoneDetail from "../views/MilestoneDetail.vue";
|
||||
import Subjects from "../views/Subjects.vue";
|
||||
import SubjectDetail from "../views/SubjectDetail.vue";
|
||||
import MyWorkbench from "../views/workbench/MyWorkbench.vue";
|
||||
import Aes from "../views/Aes.vue";
|
||||
import AeDetail from "../views/AeDetail.vue";
|
||||
import DataQueries from "../views/DataQueries.vue";
|
||||
import DataQueryDetail from "../views/DataQueryDetail.vue";
|
||||
import Imp from "../views/Imp.vue";
|
||||
import ImpProducts from "../views/ImpProducts.vue";
|
||||
import ImpBatches from "../views/ImpBatches.vue";
|
||||
import ImpInventory from "../views/ImpInventory.vue";
|
||||
import ImpTransactions from "../views/ImpTransactions.vue";
|
||||
import Finance from "../views/Finance.vue";
|
||||
import FinanceDetail from "../views/FinanceDetail.vue";
|
||||
import Faq from "../views/Faq.vue";
|
||||
import FaqDetail from "../views/FaqDetail.vue";
|
||||
import Issues from "../views/Issues.vue";
|
||||
import IssueDetail from "../views/IssueDetail.vue";
|
||||
import Verification from "../views/Verification.vue";
|
||||
import AuditLogs from "../views/admin/AuditLogs.vue";
|
||||
import AdminUsers from "../views/admin/Users.vue";
|
||||
import AdminUserApproval from "../views/admin/AdminUserApproval.vue";
|
||||
@@ -34,6 +15,35 @@ import ProjectMembers from "../views/admin/ProjectMembers.vue";
|
||||
import AdminSites from "../views/admin/Sites.vue";
|
||||
import ProjectDetail from "../views/admin/ProjectDetail.vue";
|
||||
import ProfileSettings from "../views/ProfileSettings.vue";
|
||||
import ProjectOverview from "../views/ia/ProjectOverview.vue";
|
||||
import FinanceContracts from "../views/ia/FinanceContracts.vue";
|
||||
import FinanceSpecial from "../views/ia/FinanceSpecial.vue";
|
||||
import DrugShipments from "../views/ia/DrugShipments.vue";
|
||||
import StartupFeasibilityEthics from "../views/ia/StartupFeasibilityEthics.vue";
|
||||
import StartupMeetingAuth from "../views/ia/StartupMeetingAuth.vue";
|
||||
import SubjectManagement from "../views/ia/SubjectManagement.vue";
|
||||
import MonitoringPlaceholder from "../views/ia/MonitoringPlaceholder.vue";
|
||||
import AuditPlaceholder from "../views/ia/AuditPlaceholder.vue";
|
||||
import KnowledgeMedicalConsult from "../views/ia/KnowledgeMedicalConsult.vue";
|
||||
import KnowledgeNotes from "../views/ia/KnowledgeNotes.vue";
|
||||
import ContractForm from "../views/finance/ContractForm.vue";
|
||||
import ContractDetail from "../views/finance/ContractDetail.vue";
|
||||
import SpecialForm from "../views/finance/SpecialForm.vue";
|
||||
import SpecialDetail from "../views/finance/SpecialDetail.vue";
|
||||
import ShipmentForm from "../views/drug/ShipmentForm.vue";
|
||||
import ShipmentDetail from "../views/drug/ShipmentDetail.vue";
|
||||
import FeasibilityForm from "../views/startup/FeasibilityForm.vue";
|
||||
import FeasibilityDetail from "../views/startup/FeasibilityDetail.vue";
|
||||
import EthicsForm from "../views/startup/EthicsForm.vue";
|
||||
import EthicsDetail from "../views/startup/EthicsDetail.vue";
|
||||
import KickoffForm from "../views/startup/KickoffForm.vue";
|
||||
import KickoffDetail from "../views/startup/KickoffDetail.vue";
|
||||
import TrainingForm from "../views/startup/TrainingForm.vue";
|
||||
import TrainingDetail from "../views/startup/TrainingDetail.vue";
|
||||
import NoteForm from "../views/knowledge/NoteForm.vue";
|
||||
import NoteDetail from "../views/knowledge/NoteDetail.vue";
|
||||
import SubjectForm from "../views/subjects/SubjectForm.vue";
|
||||
import SubjectDetail from "../views/subjects/SubjectDetail.vue";
|
||||
|
||||
const routes: RouteRecordRaw[] = [
|
||||
{
|
||||
@@ -66,130 +76,238 @@ const routes: RouteRecordRaw[] = [
|
||||
meta: { title: "个人设置" },
|
||||
},
|
||||
{
|
||||
path: "study/home",
|
||||
name: "StudyHome",
|
||||
component: StudyHome,
|
||||
meta: { title: "项目首页", requiresStudy: true },
|
||||
path: "project/overview",
|
||||
name: "ProjectOverview",
|
||||
component: ProjectOverview,
|
||||
meta: { title: "项目总览", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "study/milestones",
|
||||
name: "StudyMilestones",
|
||||
component: Milestones,
|
||||
meta: { title: "伦理与启动", requiresStudy: true },
|
||||
path: "finance/contracts",
|
||||
name: "FinanceContracts",
|
||||
component: FinanceContracts,
|
||||
meta: { title: "合同费用", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "study/milestones/:milestoneId",
|
||||
name: "StudyMilestoneDetail",
|
||||
component: MilestoneDetail,
|
||||
meta: { title: "节点详情", requiresStudy: true },
|
||||
path: "finance/contracts/new",
|
||||
name: "FinanceContractNew",
|
||||
component: ContractForm,
|
||||
meta: { title: "新增合同费用", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "study/subjects",
|
||||
name: "StudySubjects",
|
||||
component: Subjects,
|
||||
meta: { title: "受试者", requiresStudy: true },
|
||||
path: "finance/contracts/:contractId",
|
||||
name: "FinanceContractDetail",
|
||||
component: ContractDetail,
|
||||
meta: { title: "合同费用详情", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "study/subjects/:subjectId",
|
||||
name: "StudySubjectDetail",
|
||||
path: "finance/contracts/:contractId/edit",
|
||||
name: "FinanceContractEdit",
|
||||
component: ContractForm,
|
||||
meta: { title: "编辑合同费用", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "finance/special",
|
||||
name: "FinanceSpecial",
|
||||
component: FinanceSpecial,
|
||||
meta: { title: "特殊费用", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "finance/special/new",
|
||||
name: "FinanceSpecialNew",
|
||||
component: SpecialForm,
|
||||
meta: { title: "新增特殊费用", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "finance/special/:specialId",
|
||||
name: "FinanceSpecialDetail",
|
||||
component: SpecialDetail,
|
||||
meta: { title: "特殊费用详情", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "finance/special/:specialId/edit",
|
||||
name: "FinanceSpecialEdit",
|
||||
component: SpecialForm,
|
||||
meta: { title: "编辑特殊费用", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "drug/shipments",
|
||||
name: "DrugShipments",
|
||||
component: DrugShipments,
|
||||
meta: { title: "药品流向", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "drug/shipments/new",
|
||||
name: "DrugShipmentNew",
|
||||
component: ShipmentForm,
|
||||
meta: { title: "新增运输记录", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "drug/shipments/:shipmentId",
|
||||
name: "DrugShipmentDetail",
|
||||
component: ShipmentDetail,
|
||||
meta: { title: "运输记录详情", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "drug/shipments/:shipmentId/edit",
|
||||
name: "DrugShipmentEdit",
|
||||
component: ShipmentForm,
|
||||
meta: { title: "编辑运输记录", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "startup/feasibility-ethics",
|
||||
name: "StartupFeasibilityEthics",
|
||||
component: StartupFeasibilityEthics,
|
||||
meta: { title: "立项与伦理", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "startup/feasibility/new",
|
||||
name: "StartupFeasibilityNew",
|
||||
component: FeasibilityForm,
|
||||
meta: { title: "新增立项记录", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "startup/feasibility/:recordId",
|
||||
name: "StartupFeasibilityDetail",
|
||||
component: FeasibilityDetail,
|
||||
meta: { title: "立项记录详情", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "startup/feasibility/:recordId/edit",
|
||||
name: "StartupFeasibilityEdit",
|
||||
component: FeasibilityForm,
|
||||
meta: { title: "编辑立项记录", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "startup/ethics/new",
|
||||
name: "StartupEthicsNew",
|
||||
component: EthicsForm,
|
||||
meta: { title: "新增伦理记录", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "startup/ethics/:recordId",
|
||||
name: "StartupEthicsDetail",
|
||||
component: EthicsDetail,
|
||||
meta: { title: "伦理记录详情", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "startup/ethics/:recordId/edit",
|
||||
name: "StartupEthicsEdit",
|
||||
component: EthicsForm,
|
||||
meta: { title: "编辑伦理记录", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "startup/meeting-auth",
|
||||
name: "StartupMeetingAuth",
|
||||
component: StartupMeetingAuth,
|
||||
meta: { title: "启动与授权", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "startup/kickoff/new",
|
||||
name: "StartupKickoffNew",
|
||||
component: KickoffForm,
|
||||
meta: { title: "新增启动会", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "startup/kickoff/:meetingId",
|
||||
name: "StartupKickoffDetail",
|
||||
component: KickoffDetail,
|
||||
meta: { title: "启动会详情", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "startup/kickoff/:meetingId/edit",
|
||||
name: "StartupKickoffEdit",
|
||||
component: KickoffForm,
|
||||
meta: { title: "编辑启动会", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "startup/training/new",
|
||||
name: "StartupTrainingNew",
|
||||
component: TrainingForm,
|
||||
meta: { title: "新增人员", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "startup/training/:recordId",
|
||||
name: "StartupTrainingDetail",
|
||||
component: TrainingDetail,
|
||||
meta: { title: "培训授权详情", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "startup/training/:recordId/edit",
|
||||
name: "StartupTrainingEdit",
|
||||
component: TrainingForm,
|
||||
meta: { title: "编辑培训授权", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "subjects",
|
||||
name: "SubjectManagement",
|
||||
component: SubjectManagement,
|
||||
meta: { title: "受试者管理", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "subjects/new",
|
||||
name: "SubjectNew",
|
||||
component: SubjectForm,
|
||||
meta: { title: "新增受试者", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "subjects/:subjectId",
|
||||
name: "SubjectDetail",
|
||||
component: SubjectDetail,
|
||||
meta: { title: "受试者详情", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "study/aes",
|
||||
name: "StudyAes",
|
||||
component: Aes,
|
||||
meta: { title: "AE", requiresStudy: true },
|
||||
path: "subjects/:subjectId/edit",
|
||||
name: "SubjectEdit",
|
||||
component: SubjectForm,
|
||||
meta: { title: "编辑受试者", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "study/aes/:aeId",
|
||||
name: "StudyAeDetail",
|
||||
component: AeDetail,
|
||||
meta: { title: "AE详情", requiresStudy: true },
|
||||
path: "monitoring",
|
||||
name: "MonitoringPlaceholder",
|
||||
component: MonitoringPlaceholder,
|
||||
meta: { title: "监查", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "study/data-queries",
|
||||
name: "StudyDataQueries",
|
||||
component: DataQueries,
|
||||
meta: { title: "数据问题", requiresStudy: true },
|
||||
path: "audit",
|
||||
name: "AuditPlaceholder",
|
||||
component: AuditPlaceholder,
|
||||
meta: { title: "稽查", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "study/data-queries/:queryId",
|
||||
name: "StudyDataQueryDetail",
|
||||
component: DataQueryDetail,
|
||||
meta: { title: "数据问题详情", requiresStudy: true },
|
||||
path: "knowledge/medical-consult",
|
||||
name: "KnowledgeMedicalConsult",
|
||||
component: KnowledgeMedicalConsult,
|
||||
meta: { title: "医学咨询", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "study/issues",
|
||||
name: "StudyIssues",
|
||||
component: Issues,
|
||||
meta: { title: "风险/问题", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "study/issues/:issueId",
|
||||
name: "StudyIssueDetail",
|
||||
component: IssueDetail,
|
||||
meta: { title: "风险详情", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "study/imp",
|
||||
name: "StudyImp",
|
||||
component: Imp,
|
||||
meta: { title: "药品", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "study/imp/products",
|
||||
name: "StudyImpProducts",
|
||||
component: ImpProducts,
|
||||
meta: { title: "IMP 产品", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "study/imp/batches",
|
||||
name: "StudyImpBatches",
|
||||
component: ImpBatches,
|
||||
meta: { title: "IMP 批次", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "study/imp/inventory",
|
||||
name: "StudyImpInventory",
|
||||
component: ImpInventory,
|
||||
meta: { title: "IMP 库存", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "study/imp/transactions",
|
||||
name: "StudyImpTransactions",
|
||||
component: ImpTransactions,
|
||||
meta: { title: "IMP 交易", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "study/finance",
|
||||
name: "StudyFinance",
|
||||
component: Finance,
|
||||
meta: { title: "费用", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "study/finance/:itemId",
|
||||
name: "StudyFinanceDetail",
|
||||
component: FinanceDetail,
|
||||
meta: { title: "费用详情", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "study/faq",
|
||||
name: "StudyFaq",
|
||||
component: Faq,
|
||||
meta: { title: "FAQ", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "study/faq/:itemId",
|
||||
name: "StudyFaqDetail",
|
||||
path: "knowledge/medical-consult/:itemId",
|
||||
name: "KnowledgeMedicalConsultDetail",
|
||||
component: FaqDetail,
|
||||
meta: { title: "FAQ 详情", requiresStudy: true },
|
||||
meta: { title: "医学咨询详情", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "study/verifications",
|
||||
name: "StudyVerifications",
|
||||
component: Verification,
|
||||
meta: { title: "核查进度", requiresStudy: true },
|
||||
path: "knowledge/notes",
|
||||
name: "KnowledgeNotes",
|
||||
component: KnowledgeNotes,
|
||||
meta: { title: "注意事项", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "knowledge/notes/new",
|
||||
name: "KnowledgeNoteNew",
|
||||
component: NoteForm,
|
||||
meta: { title: "新增注意事项", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "knowledge/notes/:noteId",
|
||||
name: "KnowledgeNoteDetail",
|
||||
component: NoteDetail,
|
||||
meta: { title: "注意事项详情", requiresStudy: true },
|
||||
},
|
||||
{
|
||||
path: "knowledge/notes/:noteId/edit",
|
||||
name: "KnowledgeNoteEdit",
|
||||
component: NoteForm,
|
||||
meta: { title: "编辑注意事项", requiresStudy: true },
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -270,7 +388,7 @@ router.beforeEach(async (to, _from, next) => {
|
||||
}
|
||||
if ((to.path === "/login" || to.path === "/register") && token) {
|
||||
if (!auth.forceLogin) {
|
||||
next({ path: studyStore.currentStudy ? "/study/home" : "/workbench" });
|
||||
next({ path: studyStore.currentStudy ? "/project/overview" : "/workbench" });
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -282,16 +400,16 @@ router.beforeEach(async (to, _from, next) => {
|
||||
const role = auth.user?.role;
|
||||
const studyRole = studyStore.currentStudyRole;
|
||||
if (!(role === "ADMIN" || role === "PM" || studyRole === "PM")) {
|
||||
next({ path: "/study/home" });
|
||||
next({ path: "/project/overview" });
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (to.path.startsWith("/study") && !studyStore.currentStudy) {
|
||||
if (to.meta.requiresStudy && !studyStore.currentStudy) {
|
||||
next({ path: "/workbench" });
|
||||
return;
|
||||
}
|
||||
if (to.path === "/workbench" && studyStore.currentStudy) {
|
||||
next({ path: "/study/home" });
|
||||
next({ path: "/project/overview" });
|
||||
return;
|
||||
}
|
||||
next();
|
||||
|
||||
Reference in New Issue
Block a user