import MainLayout from "@/layouts/MainLayout.vue";

const routes = [
  {
    path: "/login",
    name: "login",
    component: () => import("@/views/login/index.vue"),
    meta: { nopermission: true, title: "登录" },
  },
  {
    path: "/gzbPage",
    name: "gzbPage",
    title: "数据大屏",
    component: () => import("@/views/homePage/index.vue"),
    meta: { nopermission: true, title: "数据大屏", hideTabs: false },
  },
  {
    path: "/",
    name: "首页",
    redirect: "/message",
    component: MainLayout,
    meta: { title: "首页" },
    children: [
      {
        path: "/message",
        name: "message",
        title: "消息中心",
        meta: { title: "消息中心" },
        component: () => import("@/views/systemManage/message.vue"),
      },
      {
        path: "/homePage",
        name: "dataSummary",
        title: "数据大屏",
        meta: { title: "数据大屏" },
        component: () => import("@/views/homePage/index.vue"),
      },
      {
        path: "/projectManage",
        name: "projectManage",
        title: "投前管理",
        redirect: "/projectAllPage",
        meta: { title: "投前管理" },
        children: [
          {
            path: "/projectDraft",
            name: "projectDraft",
            title: "项目遴选",
            meta: { title: "项目遴选" },
            component: () => import("@/views/projectManage/projectDraft.vue"),
          },
          {
            path: "/projectSetUp",
            name: "projectSetUp",
            title: "项目立项",
            meta: { title: "项目立项" },
            component: () => import("@/views/projectManage/projectSetUp.vue"),
          },
          {
            path: "/projectArgument",
            name: "projectArgument",
            title: "项目论证",
            meta: { title: "项目论证" },
            component: () =>
              import("@/views/projectManage/projectArgument.vue"),
          },
          {
            path: "/projectDecision",
            name: "projectDecision",
            title: "项目决策",
            meta: { title: "项目决策" },
            component: () =>
              import("@/views/projectManage/projectDecision.vue"),
          },
          {
            path: "/projectAllPage",
            name: "projectAllPage",
            title: "项目档案库",
            meta: { title: "项目档案库" },
            component: () => import("@/views/projectManage/projectAllPage.vue"),
          },
          {
            path: "/xmdakDetaill",
            name: "xmdakDetaill",
            title: "项目档案库",
            meta: { title: "项目档案库" },
            component: () => import("@/views/projectManage/xmdakDetaill.vue"),
          },
          {
            path: "/addProject",
            name: "addProject",
            title: "项目详情",
            meta: { title: "项目详情" },
            component: () => import("@/views/projectManage/addProject.vue"),
          },
        ],
      },
      {
        path: "/investingManage",
        name: "investingManage",
        title: "投中管理",
        redirect: "/targetLiabilityStatement",
        meta: { title: "投中管理" },
        children: [
          {
            path: "/targetLiabilityStatement",
            name: "targetLiabilityStatement",
            title: "投资目标责任书",
            meta: { title: "投资目标责任书" },
            component: () =>
              import("@/views/investingManage/targetLiabilityStatement.vue"),
          },
          {
            path: "/addStatement",
            name: "addStatement",
            title: "新增责任书",
            meta: { title: "新增责任书详情" }, // 修改：新增责任书 → 新增责任书详情
            component: () => import("@/views/investingManage/addStatement.vue"),
          },
          {
            path: "/targetControl",
            name: "targetControl",
            title: "投资控制",
            meta: { title: "投资控制" },
            component: () =>
              import("@/views/investingManage/targetControl.vue"),
          },
          {
            path: "/addControl",
            name: "addControl",
            title: "新增投资控制",
            meta: { title: "新增投资控制详情" }, // 修改：新增投资控制 → 新增投资控制详情
            component: () => import("@/views/investingManage/addControl.vue"),
          },
          {
            path: "/majorRisk",
            name: "majorRisk",
            title: "重大风险防控",
            meta: { title: "重大风险防控" },
            component: () => import("@/views/investingManage/majorRisk.vue"),
          },
          {
            path: "/constructionTime",
            name: "constructionTime",
            title: "建设期投资回收",
            meta: { title: "建设期投资回收" },
            component: () =>
              import("@/views/investingManage/constructionTime.vue"),
          },
          {
            path: "/constructionTimeAdd",
            name: "constructionTimeAdd",
            title: "建设期投资回收",
            meta: { title: "建设期投资回收详情" }, // 修改：建设期投资回收 → 建设期投资回收详情
            component: () =>
              import("@/views/investingManage/constructionTimeAdd.vue"),
          },
          {
            path: "/addRisk",
            name: "addRisk",
            title: "新增重大风险",
            meta: { title: "新增重大风险详情" }, // 修改：新增重大风险 → 新增重大风险详情
            component: () => import("@/views/investingManage/addRisk.vue"),
          },
          {
            path: "/construction",
            name: "construction",
            title: "建设期投资检查",
            meta: { title: "建设期投资检查" },
            component: () => import("@/views/investingManage/construction.vue"),
          },
          {
            path: "/constructionAdd",
            name: "constructionAdd",
            title: "建设期投资检查",
            meta: { title: "建设期投资检查详情" }, // 修改：建设期投资检查 → 建设期投资检查详情
            component: () =>
              import("@/views/investingManage/constructionAdd.vue"),
          },
          {
            path: "/bigIssues",
            name: "bigIssues",
            title: "重大事项审批",
            meta: { title: "重大事项审批" },
            component: () => import("@/views/investingManage/bigIssues.vue"),
          },
          {
            path: "/bigIssuesAdd",
            name: "bigIssuesAdd",
            title: "重大事项审批",
            meta: { title: "重大事项审批详情" }, // 修改：重大事项审批 → 重大事项审批详情
            component: () => import("@/views/investingManage/bigIssuesAdd.vue"),
          },
          {
            path: "/quit",
            name: "quit",
            title: "项目退出",
            meta: { title: "项目退出" },
            component: () => import("@/views/investingManage/quit.vue"),
          },
          {
            path: "/quitAdd",
            name: "quitAdd",
            title: "项目退出",
            meta: { title: "项目退出详情" }, // 修改：项目退出 → 项目退出详情
            component: () => import("@/views/investingManage/quitAdd.vue"),
          },
          {
            path: "/decision",
            name: "decision",
            title: "重新决策",
            meta: { title: "重新决策" },
            component: () => import("@/views/investingManage/decision.vue"),
          },
          {
            path: "/decisionAdd",
            name: "decisionAdd",
            title: "重新决策",
            meta: { title: "重新决策详情" }, // 修改：重新决策 → 重新决策详情
            component: () => import("@/views/investingManage/decisionAdd.vue"),
          },
        ],
      },
      {
        path: "/castbehind",
        name: "castbehind",
        title: "投后管理",
        redirect: "/runningPeriod",
        meta: { title: "投后管理" },
        children: [
          {
            path: "/investmentCecovery",
            name: "investmentCecovery",
            title: "运营期投资回收",
            meta: { title: "运营期投资回收" },
            component: () =>
              import("@/views/castbehind/investmentCecovery.vue"),
          },
          {
            path: "/investmentCecoveryAdd",
            name: "investmentCecoveryAdd",
            title: "运营期投资回收",
            meta: { title: "运营期投资回收详情" }, // 已按要求修改，保持一致
            component: () =>
              import("@/views/castbehind/investmentCecoveryAdd.vue"),
          },
          {
            path: "/runningPeriod",
            name: "runningPeriod",
            title: "运营期投资检查",
            meta: { title: "运营期投资检查" },
            component: () => import("@/views/castbehind/runningPeriod.vue"),
          },
          {
            path: "/runningPeriodAdd",
            name: "runningPeriodAdd",
            title: "运营期投资检查",
            meta: { title: "运营期投资检查详情" }, // 修改：运营期投资检查 → 运营期投资检查详情
            component: () => import("@/views/castbehind/runningPeriodAdd.vue"),
          },
          {
            path: "/evaluate",
            name: "evaluate",
            title: "投资后评价",
            meta: { title: "投资后评价" },
            component: () => import("@/views/castbehind/evaluate.vue"),
          },
          {
            path: "/evaluateAdd",
            name: "evaluateAdd",
            title: "投资后评价",
            meta: { title: "投资后评价详情" }, // 修改：投资后评价 → 投资后评价详情
            component: () => import("@/views/castbehind/evaluateAdd.vue"),
          },
          {
            path: "/turnover",
            name: "turnover",
            title: "移交管理",
            meta: { title: "移交管理" },
            component: () => import("@/views/castbehind/turnover.vue"),
          },
          {
            path: "/turnoverAdd",
            name: "turnoverAdd",
            title: "移交管理",
            meta: { title: "移交管理详情" }, // 修改：移交管理 → 移交管理详情
            component: () => import("@/views/castbehind/turnoverAdd.vue"),
          },
        ],
      },
      {
        path: "/templateManage",
        name: "templateManage",
        title: "模板管理",
        meta: { title: "模板管理" },
        component: () => import("@/views/projectManage/templateManage.vue"),
      },
      {
        path: "/everydayPage",
        name: "everydayPage",
        title: "日常管理",
        redirect: "/share",
        meta: { title: "日常管理" },
        children: [
          {
            path: "/share",
            name: "share",
            title: "参股企业管理",
            meta: { title: "参股企业管理" },
            component: () => import("@/views/everydayPage/share.vue"),
          },
          {
            path: "/shareAdd",
            name: "shareAdd",
            title: "参股企业管理",
            meta: { title: "参股企业管理详情" }, // 修改：参股企业管理 → 参股企业管理详情
            component: () => import("@/views/everydayPage/shareAdd.vue"),
          },
          {
            path: "/SuperFormExample",
            name: "SuperFormExample",
            title: "测试组件",
            meta: { title: "测试组件" },
            component: () =>
              import("@/views/everydayPage/SuperFormExample.vue"),
          },
          {
            path: "/system",
            name: "system",
            title: "体系建设",
            meta: { title: "体系建设" },
            component: () => import("@/views/everydayPage/system.vue"),
          },
          {
            path: "/systemAdd",
            name: "systemAdd",
            title: "体系建设",
            meta: { title: "体系建设详情" }, // 修改：体系建设 → 体系建设详情
            component: () => import("@/views/everydayPage/systemAdd.vue"),
          },
          {
            path: "/investment",
            name: "investment",
            title: "投资规划",
            meta: { title: "投资规划" },
            component: () => import("@/views/everydayPage/investment.vue"),
          },
          {
            path: "/investmentAdd",
            name: "investmentAdd",
            title: "投资规划",
            meta: { title: "投资规划详情" }, // 修改：投资规划 → 投资规划详情
            component: () => import("@/views/everydayPage/investmentAdd.vue"),
          },
          {
            path: "/everyday",
            name: "everyday",
            title: "日常信息",
            meta: { title: "日常信息" },
            component: () => import("@/views/everydayPage/everyday.vue"),
          },
          {
            path: "/everydayAdd",
            name: "everydayAdd",
            title: "日常信息",
            meta: { title: "日常信息详情" }, // 修改：日常信息 → 日常信息详情
            component: () => import("@/views/everydayPage/everydayAdd.vue"),
          },
          {
            path: "/informationConstruction",
            name: "informationConstruction",
            title: "问题反馈",
            meta: { title: "问题反馈" },
            component: () =>
              import("@/views/everydayPage/informationConstruction.vue"),
          },
          {
            path: "/informationConstructionAdd",
            name: "informationConstructionAdd",
            title: "问题反馈",
            meta: { title: "问题反馈详情" },
            component: () =>
              import("@/views/everydayPage/informationConstructionAdd.vue"),
          },
          {
            path: "/vscouncil",
            name: "vscouncil",
            title: "投委会管理",
            meta: { title: "投委会管理" },
            component: () => import("@/views/everydayPage/vscouncil.vue"),
          },
          {
            path: "/vscouncilAdd",
            name: "vscouncilAdd",
            title: "投委会管理",
            meta: { title: "投委会管理详情" }, // 修改：投委会管理 → 投委会管理详情
            component: () => import("@/views/everydayPage/vscouncilAdd.vue"),
          },
          {
            path: "/record",
            name: "record",
            title: "投资档案管理",
            meta: { title: "投资档案管理" },
            component: () => import("@/views/everydayPage/record.vue"),
          },
          {
            path: "/recordAdd",
            name: "recordAdd",
            title: "投资档案管理",
            meta: { title: "投资档案管理详情" }, // 修改：投资档案管理 → 投资档案管理详情
            component: () => import("@/views/everydayPage/recordAdd.vue"),
          },
          {
            path: "/annual",
            name: "annual",
            title: "年度计划",
            meta: { title: "年度计划" }, // 列表页保持原标题
            component: () => import("@/views/everydayPage/annual.vue"),
          },
          {
            path: "/annualAdd",
            name: "annualAdd",
            title: "年度计划",
            meta: { title: "年度计划详情" }, // 核心修改：年度计划 → 年度计划详情
            component: () => import("@/views/everydayPage/annualAdd.vue"),
          },
        ],
      },
      {
        path: "/elseManage",
        name: "elseManage",
        title: "其他管理",
        redirect: "/share",
        meta: { title: "其他管理" },
        children: [
          {
            path: "/cost",
            name: "cost",
            title: "成本管理",
            meta: { title: "成本管理" },
            component: () => import("@/views/elseManage/cost.vue"),
          },
          {
            path: "/costAdd",
            name: "costAdd",
            title: "成本管理",
            meta: { title: "成本管理详情" },
            component: () => import("@/views/elseManage/costAdd.vue"),
          },
          {
            path: "/workForHousing",
            name: "workForHousing",
            title: "工抵房管理",
            meta: { title: "工抵房管理" },
            component: () => import("@/views/elseManage/workForHousing.vue"),
          },
          {
            path: "/workForHousingAdd",
            name: "workForHousingAdd",
            title: "工抵房管理详情",
            meta: { title: "工抵房管理详情" },
            component: () => import("@/views/elseManage/workForHousingAdd.vue"),
          },
          {
            path: "/property",
            name: "property",
            title: "资产管理情况",
            meta: { title: "资产管理情况" },
            component: () => import("@/views/elseManage/property.vue"),
          },
          {
            path: "/link",
            name: "link",
            title: "链接管理",
            meta: { title: "链接管理" },
            component: () => import("@/views/elseManage/link.vue"),
          },
        ],
      },
      {
        path: "/systemManage",
        name: "systemManage",
        title: "系统管理",
        meta: { menuName: "系统管理", title: "系统管理" },
        children: [
          {
            path: "departManage",
            name: "departManage",
            title: "部门管理",
            meta: { title: "部门管理" },
            component: () => import("@/views/systemManage/departManage.vue"),
          },
          {
            path: "userManage",
            name: "userManage",
            title: "用户管理",
            meta: { title: "用户管理" },
            component: () => import("@/views/systemManage/userManage.vue"),
          },
          {
            path: "roleManage",
            name: "roleManage",
            title: "角色管理",
            meta: { title: "角色管理" },
            component: () => import("@/views/systemManage/roleManage.vue"),
          },
          {
            path: "menuManage",
            name: "menuManage",
            title: "菜单管理",
            meta: { title: "菜单管理" },
            component: () => import("@/views/systemManage/menuManage.vue"),
          },
          {
            path: "resourceManage",
            name: "resourceManage",
            title: "资源库管理",
            meta: { title: "资源库管理" },
            component: () => import("@/views/systemManage/resourceManage.vue"),
          },
        ],
      },
      {
        path: "/building",
        name: "building",
        title: "建设中",
        meta: { title: "建设中" },
        component: () => import("@/views/homePage/building.vue"),
      },
    ],
  },
];
export { routes };
