Redo Log Data Dictionary Views

本文主要介绍了Oracle数据库中重做日志的重要性,它记录数据库的所有更改,确保数据库完整性,归档重做日志有助于成功备份。还详细阐述了Oracle 7提供的多个用于监控重做日志的视图,如v$log、v$log_history等,并说明了数据库日志模式、自动归档等相关信息。
Introduction 

============

Redo logs are essential to the recovery of your database. They record all the

changes that are made to the database. They also ensure the integrity of your

database. Archiving redo logs will help ensure a successful backup.

ORACLE has provided numerous views in version 7 that allow you to monitor your

redo logs.

The following views are discussed:

v$log

v$log_history

v$logfile

v$loghist

v$database

Oracle7 Redo Logs

=================

Redo logs are key components in the recovery of your database. Redo logs

contain both the redo and undo changes needed to make your database

consistent. When an user commits a transaction, ORACLE guarantees that

the changes to the blocks are written to the redo logs. Furthermore, undo

information needed to roll back uncommitted transactions are also stored

in the redo logs/archive files. Thereby, during instance recovery,

oracle will roll forward applying the redo and then roll back applying the

undo. The result is a consistent version of the database.

In oracle 7, there are numerous views that allow the user to familiarize

themselves with redo logs. Here are a listing of these views as well as

some helpful hints in interpreting the information found in these views.

v$log:

log file information from control file.

Name Null? Type DESCRIPTION

-------------- -------- ----

-----------------------------------------

GROUP# NUMBER LOG GROUP NUMBER

THREAD# NUMBER LOG THREAD NUMBER

SEQUENCE# NUMBER LOG SEQUENCE NUMBER

BYTES NUMBER SIZE OF THE LOG IN BYTES

MEMBERS NUMBER NUMBER OF MEMBERS IN LOG GROUP

ARCHIVED VARCHAR2(3) ARCHIVE STATUS: T/F

STATUS VARCHAR2(8) STATUS OF THE REDO LOGS

FIRST_CHANGE# NUMBER LOWEST SCN IN THE LOG

FIRST_TIME VARCHAR2(20) TIME OF THE FIRST SCN IN THE LOG

There must be at least two groups with one member each in every database.

We recommend to have at least two members in each group on separate disk

drives; thereby, you will be preventing the case where there is just one single

point of redo failure. Each instance will have an associated thread and the

combination of the thread# and the sequence# distinguishes a log file and an

archive file. Each member within a group should have the same size redo logs

but we recommend that all groups have identical sizes. SCN (SYSTEM COMMIT

NUMBER) is the key internal value that determines at what state or "time" the

database is at. Every time you do a select, you basically grab

a consistent view of the database, a SCN. Thereby, a SCN is like a logical

clock. When you recover, you are recovering to a specific time of the

database.

ARCHIVED:

YES The content of the file has been archived. For a newly added

redo log file, the field is YES, regardless the archive mode.

NO otherwise.

STATUS:

UNUSED indicates the online redo log has not been written to.

This is the state of a redo log that was just added or just

after a RESETLOGS when it is not the current redo log.

CURRENT indicates this is the current redo log. This implies that

the redo log is active. The redo log could be open or

closed.

ACTIVE indicate the log is active but is not the current log. It

is needed for crash recovery. It may be in use for block

recovery. It might or might not be archived.

INACTIVE indicate the log is no longer needed for crash recovery. It

may be in use for media recover. It might or might not be

archived.

v$log_history:

archived log names for all logs in the log history.

Name Null? Type DESCRIPTION

---------------- -------- ---- ----------------------------------

THREAD# NUMBER THREAD NUMBER OF ARCHIVED LOG

SEQUENCE# NUMBER SEQUENCE NUMBER

TIME VARCHAR2(20) TIME OF THE LOWEST SCN IN THE LOG

LOW_CHANGE# NUMBER LOWEST SCN

HIGH_CHANGE# NUMBER HIGHEST SCN

ARCHIVE_NAME VARCHAR2(257) ARCHIVE FILE NAME

v$logfile:

information about all redo logs.

Name Null? Type DESCRIPTION

-------------- ----- ---- --------------------------------

GROUP# NUMBER REDO LOG GROUP IDENTIFIER NUMBER

STATUS VARCHAR2(7) STATUS OF THIS LOG MEMBER

MEMBER VARCHAR2(257) REDO LOG MEMBER NAME

STATUS:

INVALID -FILE IS INACCESSIBLE

STALE -FILE CONTENTS ARE INCOMPLETE

DELETE -FILE IS NO LONGER USED

BLANK -FILE IS IN USE.

v$loghist:

log history from the control file.

Name Null? Type DESCRIPTION

------------- -------- ---- ----------------------

THREAD# NUMBER LOG THREAD NUMBER

SEQUENCE# NUMBER LOG SEQUENCE NUMBER

FIRST_CHANGE# NUMBER LOWEST SCN IN THE LOG

FIRST_TIME VARCHAR2(20) TIME OF THE FIRST SCN IN THE LOG

SWITCH_CHANGE# NUMBER SCN AT WHICH THE LOG SWITCH OCCURRED;

ONE MORE THAN THE HIGHEST SCN IN THE

LOG.

v$database:

database information from the control file.

Name Null? Type DESCRIPTION

---------------- -------- ---- --------------------------

NAME VARCHAR2(9) NAME OF THE DATABASE

CREATED VARCHAR2(20) CREATION DATE

LOG_MODE VARCHAR2(12) ARCHIVE LOG MODE:

ARCHIVELOG/NOARCHIVELOG

CHECKPOINT_CHANGE# NUMBER LAST SCN CHECKPOINTED

ARCHIVE_CHANGE# NUMBER LAST SCN ARCHIVED.

In sqldba, you can get archival information by typing

ARCHIVE LOG LIST. Information about your redo logs are also shown.

Here is an example:

SQLDBA> archive log list

Database log mode NOARCHIVELOG

Automatic archival DISABLED

Archive destination /u04/oracle/6037p/dbs/arch.dbf

Oldest online log sequence 248

Current log sequence 249

Database log mode

Indicates whether or not your database is in archive mode or not.

Initially, it is set at database creation time using the CREATE

DATABASE statement. Then you can change it while your database is in

the mounted exclusive stage with the command ALTER DATABASE

ARCHIVELOG/NOARCHIVELOG

Automatic archival

Indicates if you are automatically archiving (ENABLED) or if you are

manually archiving (DISABLED).

This is set in your init.ora with the log_archive_start parameter or

you can manually adjust this with the command LOG ARCHIVE START/STOP.

.
import { createWebHistory, createRouter } from "vue-router"; /* Layout */ import Layout from "@/layout"; import { deepClone, flattenTreeList } from "@/utils"; import BasicRoute from "./routeBasic"; const modules = import.meta.glob("@/views/**"); import emitter from "@/utils/eventBus"; /** * Note: 路由配置项 * * hidden: true // 当设置 true 的时候该路由不会再侧边栏出现 如401,login等页面,或者如一些编辑页面/edit/1 * alwaysShow: true // 当你一个路由下面的 children 声明的路由大于1个时,自动会变成嵌套的模式--如组件页面 * // 只有一个时,会将那个子路由当做根路由显示在侧边栏--如引导页面 * // 若你想不管路由下面的 children 声明的个数都显示你的根路由 * // 你可以设置 alwaysShow: true,这样它就会忽略之前定义的规则,一直显示根路由 * redirect: noRedirect // 当设置 noRedirect 的时候该路由在面包屑导航中不可被点击 * name:'router-name' // 设定路由的名字,一定要填写不然使用<keep-alive>时会出现各种问题 * query: '{"id": 1, "name": "ry"}' // 访问路由的默认传递参数 * roles: ['admin', 'common'] // 访问路由的角色权限 * permissions: ['a:a:a', 'b:b:b'] // 访问路由的菜单权限 * meta : { noCache: true // 如果设置为true,则不会被 <keep-alive> 缓存(默认 false) title: 'title' // 设置该路由在侧边栏和面包屑中展示的名字 icon: 'svg-name' // 设置该路由的图标,对应路径src/assets/icons/svg breadcrumb: false // 如果设置为false,则不会在breadcrumb面包屑中显示 activeMenu: '/system/user' // 当路由设置了该属性,则会高亮相对应的侧边栏。 } */ // 公共路由 export const constantRoutes = [ { path: "/", redirect: "/myWorkbench", }, { path: "/login", name: "login", component: () => import("@/views/login"), hidden: true, }, { path: "/register", component: () => import("@/views/register"), hidden: true, }, { path: "/:pathMatch(.*)*", component: () => import("@/views/error/404"), hidden: true, }, { path: "/401", component: () => import("@/views/error/401"), hidden: true, }, ]; // 动态路由,基于用户权限动态去加载 export const dynamicRoutes = [ { path: "/search", component: Layout, redirect: "search", meta: { docTitle: "搜索", parentActive: "search", }, children: [ { name: "search", path: "/search", component: () => import("@/views/search"), }, ], }, { path: "/notice", component: Layout, redirect: "/notice", meta: { docTitle: "通知", }, children: [ { name: "notice", path: "/notice", redirect: "/notify", component: () => import("@/views/notice"), children: [ { name: "notify", path: "/notify", title: "通知", meta: { parentActive: "notice", }, component: () => import("@/views/notice/notify"), }, ], }, ], }, { path: "/myWork", component: Layout, redirect: "/dashboard", meta: { docTitle: "工作台", }, children: [ { name: "myWorkbench", path: "/myWorkbench", redirect: "/dashboard", component: () => import("@/views/myWorkbench"), children: [ { name: "dashboard", path: "/dashboard", title: "仪表盘", meta: { parentActive: "myWorkbench", }, component: () => import("@/views/myWorkbench/dashboard"), }, { name: "todoTasks", path: "/todoTasks", title: "待办任务", meta: { parentActive: "myWorkbench", }, component: () => import("@/views/myWorkbench/todoTasks"), }, { name: "reviewCenter", path: "/reviewCenter", title: "流程中心", meta: { parentActive: "myWorkbench", }, component: () => import("@/views/myWorkbench/reviewCenter"), }, ], }, ], }, { path: "/ComponentiInProject", component: Layout, redirect: "ComponentiInProject", children: [ { name: "workItems", path: "/workItems", meta: { parentActive: "ComponentiInProject", }, component: () => import("@/views/workitem"), }, { name: "projectPageSetting", path: "/projectPageSetting/:projectId", meta: { parentActive: "ProjectManagements", }, component: () => import("@/views/pm/pmpm"), props: (route) => ({ projectId: route.params.projectId, }), // redirect: "/projectPageSetting/overview", // 添加默认重定向 children: [ { name: "baseline", path: "baseline", component: () => import("@/views/pm/pmpm/components/baseLine/index.vue"), }, { name: "changeManager", path: "changeManager", title: "变更管理", // redirect: { name: "change-manager-list" }, component: () => import("@/views/changeManager/index.vue"), children: [ { name: "change-manager-list", path: "manager", component: () => import("@/views/changeManager/components/manage.vue"), }, { name: "change-ledger-list", path: "ledger", component: () => import("@/views/changeManager/components/ledger.vue"), }, ] }, { name: "workItem", path: "work-item", component: () => import("@/views/workitem/index.vue"), }, { name: "testManager", path: "test-manager", component: () => import("@/views/pm/pmpm/components/testManager"), redirect: { name: "testOverview" }, children: [ { name: "testOverview", path: "overview", component: () => import( "@/views/pm/pmpm/components/testManager/overview/index" ), }, { name: "testCase", path: "case", component: () => import("@/views/pm/pmpm/components/testManager/case/index"), redirect: { name: "testCaseLibrary" }, children: [ { name: "testCaseLibrary", path: "library", component: () => import( "@/views/pm/pmpm/components/testManager/case/libraryList" ), }, { name: "testCaseList", path: "list/:libraryId", component: () => import( "@/views/pm/pmpm/components/testManager/case/case" ), }, { name: "testCaseList2", path: "list2/:libraryId", component: () => import( "@/views/pm/pmpm/components/testManager/case/caseList/caselist" ), }, ], }, { name: "testPlan", path: "plan", component: () => import("@/views/pm/pmpm/components/testManager/plan/index"), redirect: { name: "planList" }, children: [ { name: "planList", path: "list", component: () => import( "@/views/pm/pmpm/components/testManager/plan/planList" ), }, { name: "planDetail", path: "detail/:planId", component: () => import( "@/views/pm/pmpm/components/testManager/plan/planLibrary" ), }, ], }, { name: "testReport", path: "report", component: () => import( "@/views/pm/pmpm/components/testManager/report/reportList" ), }, ], }, { name: "overview", path: "overview", component: () => import("@/views/pm/pmpm/components/overview/index.vue"), }, { name: "member", path: "member", component: () => import("@/views/pm/pmpm/components/member/index.vue"), }, { name: "communicationDesign", path: "communication-design", component: () => import("@/views/pm/pmpm/components/communicationDesign/index.vue"), }, { name: "checklist", path: "software-inventory", component: () => import("@/views/pm/pmpm/components/softwareInventory/index.vue"), }, { name: "funcSecurity", path: "funcSecurity", redirect: { name: "hara" }, component: () => import("@/views/pm/pmpm/components/funcSecurity/index.vue"), children: [ { name: "hara", path: "hara", component: () => import("@/views/pm/pmpm/components/funcSecurity/component/hara.vue"), }, { name: "func-sec-fault", path: "fault", component: () => import("@/views/pm/pmpm/components/funcSecurity/component/fault.vue"), }, { name: "func-sec-hazard", path: "hazard", component: () => import("@/views/pm/pmpm/components/funcSecurity/component/hazard.vue"), }, { name: "func-sec-scene", path: "scene", component: () => import("@/views/pm/pmpm/components/funcSecurity/component/scene.vue"), }, { name: "func-sec-event", path: "event", component: () => import("@/views/pm/pmpm/components/funcSecurity/component/event.vue"), }, { name: "func-sec-target", path: "target", component: () => import("@/views/pm/pmpm/components/funcSecurity/component/target.vue"), }, ] }, // { // name: "projectPlan", // path: "project-plan", // title: "项目计划", // redirect: { name: "plan-list" }, // component: () => // import("@/views/pm/pmpm/components/projectPlan/index.vue"), // children: [ // { // name: "plan-list", // path: "plan", // component: () => import("@/views/pm/pmpm/components/projectPlan/plan/index.vue"), // }, // { // name: "milestone-list", // path: "milestone", // component: () => import("@/views/pm/pmpm/components/projectPlan/milestone/index.vue"), // }, // ] // }, { name: "bugManager", path: "bugManager", component: () => import("@/views/pm/pmpm/components/bugManager/index.vue"), }, { name: "iteration", path: "iteration", component: () => import("@/views/pm/pmpm/components/iteration/index.vue"), }, { name: "knowledgeBase", path: "knowledge-base", component: () => import("@/views/pm/pmpm/components/pmpmWiki/index.vue"), redirect: { name: 'pmRecently'}, children: [ { name: "pmRecently", path: "recently", title: "最近", icon: "time", meta: { parentActive: "pmWiki", }, component: () => import("@/views/wiki/recently"), }, { name: "pMycollectiton", path: "mycollectiton", title: "我的收藏", icon: "rate", meta: { parentActive: "pmWiki", }, component: () => import("@/views/wiki/mycollectiton"), }, { name: "pmShare", path: "share", title: "与我共享", icon: "redo", meta: { parentActive: "pmWiki", }, component: () => import("@/views/wiki/share"), }, // { // path: "shareManage", // redirect: "/shareManage/:knowledgeGroupId", // children: [ // { // path: "/shareManage/:knowledgeGroupId", // name: "pmShareManage", // component: () => import("@/views/wiki/shareManage"), // meta: { // parentActive: "pmWiki", // topActive: "share" // }, // }, // ], // }, { path: "shareManage/:knowledgeGroupId", name: "pmShareManage", component: () => import("@/views/wiki/shareManage"), meta: { parentActive: "pmWiki", topActive: "pmShare" }, }, { name: "pmPageGroup", path: "pageGroup", title: "知识库", icon: "space", meta: { parentActive: "pmWiki", }, component: () => import("@/views/wiki/pageGroup"), }, { name: "pmInsightOverview", path: "insightOverview", title: "数据统计", icon: "monitor", meta: { parentActive: "pmWiki", }, component: () => import("@/views/wiki/insightOverview"), }, // { // path: "pageGroupManage", // redirect: "pageGroupManage", // children: [ // { // path: "pageGroupManage/:knowledgeGroupId", // name: "pmPageGroupManage", // component: () => import("@/views/wiki/pageGroupManage"), // meta: { // parentActive: "pmWiki", // topActive: "pageGroup" // }, // }, // ], // }, { path: "pageGroupManage/:knowledgeGroupId", name: "pmPageGroupManage", component: () => import("@/views/wiki/pageGroupManage"), meta: { parentActive: "pmWiki", topActive: "pmPageGroup" }, }, // { // path: "archiveManage", // redirect: "archiveManage/:knowledgeGroupId", // children: [ // { // path: "archiveManage/:knowledgeGroupId", // name: "pmArchiveManage", // component: () => import("@/views/wiki/archiveManage"), // meta: { // parentActive: "pmWiki", // topActive: "pageGroup" // }, // }, // ], // }, { path: "archiveManage/:knowledgeGroupId", name: "pmArchiveManage", component: () => import("@/views/wiki/archiveManage"), meta: { parentActive: "pmWiki", topActive: "pmPageGroup" }, }, // { // path: "pageGroupSet", // redirect: "pageGroupSet/:knowledgeGroupId", // children: [ // { // path: "pageGroupSet/:knowledgeGroupId", // name: "pmPageGroupSet", // component: () => import("@/views/wiki/pageGroupSet"), // meta: { // parentActive: "pmWiki", // topActive: "pageGroup" // }, // }, // ], // }, { path: "pageGroupSet/:knowledgeGroupId", name: "pmPageGroupSet", component: () => import("@/views/wiki/pageGroupSet"), meta: { parentActive: "pmWiki", topActive: "pmPageGroup" }, }, // { // path: "wikiHistory", // redirect: "wikiHistory/:knowledgeGroupId", // children: [ // { // path: "wikiHistory/:knowledgeGroupId", // name: "pmSikiHistory", // component: () => import("@/views/wiki/history"), // meta: { // parentActive: "pmWiki", // topActive: "pageGroup" // }, // }, // ], // }, { path: "wikiHistory/:knowledgeGroupId", name: "pmWikiHistory", component: () => import("@/views/wiki/history"), meta: { parentActive: "pmWiki", topActive: "pmPageGroup" }, }, ], }, { name: "projectPlan", path: "project-plan", title: "项目计划", redirect: { name: "plan-list" }, component: () => import("@/views/pm/pmpm/components/projectPlan/index.vue"), children: [ { name: "plan-list", path: "plan", component: () => import("@/views/pm/pmpm/components/projectPlan/plan/index.vue"), }, { name: "milestone-list", path: "milestone", component: () => import("@/views/pm/pmpm/components/projectPlan/milestone/index.vue"), }, ] }, { name: "projectSetting", path: "project-setting", component: () => import("@/views/pm/pmpm/components/setTab.vue"), }, { name: "fileManager", path: "fileManager", title: "文件管理", component: () => import("_f/views/File.vue"), }, { path: "onlyoffice", name: "Onlyoffice", meta: { title: "在线编辑预览", content: { description: "onlyoffice 文档在线编辑预览,支持 Word Excel PowerPoint", }, }, component: () => import("@/views/QWFile/views/OnlyOffice.vue"), }, { name: 'softwareManager', path: 'software-management', title: '软件管理', component: () => import("@/views/pm/pmpm/components/softwareManagement/index.vue"), children: [ // { // name: "software-board", // path: "board", // component: () => import("@/views/pm/pmpm/components/softwareManagement/board"), // }, { name: "software-train", path: "train", component: () => import("@/views/pm/pmpm/components/softwareManagement/train"), }, { name: "software-ecu", path: "ecu", component: () => import("@/views/pm/pmpm/components/softwareManagement/ECUList"), }, { name: "software-ecu-version", path: "ecu-version", component: () => import("@/views/pm/pmpm/components/softwareManagement/ECUVersionList"), }, { name: "software-delivery", path: "delivery", component: () => import("@/views/pm/pmpm/components/softwareManagement/delivery"), }, { name: "software-ecu-base-version-list", path: "ecu-base", component: () => import("@/views/pm/pmpm/components/softwareManagement/ECUBaseVersionList"), }, { name: "software-delivery-list", path: "delivery-list", component: () => import("@/views/pm/pmpm/components/softwareManagement/deliveryList"), }, { name: "efficiency-board", path: "efficiency", component: () => import("@/views/pm/pmpm/components/softwareManagement/efficiency"), }, ] }, { name: "projectTask", path: "task", title: "任务", redirect: { name: "task-list" }, component: () => import("@/views/pm/pmpm/components/taskManagement/index.vue"), children: [ { name: "task-list", path: "list", title: "任务列表", component: () => import("@/views/pm/pmpm/components/taskManagement/list.vue"), }, { name: "task-test", path: "test", title: "任务测试", component: () => import("@/views/pm/pmpm/components/taskManagement/test.vue"), } ] } ], }, ], }, { path: "/wiki", component: Layout, redirect: "/recently", meta: { docTitle: "知识库", }, children: [ { name: "wiki", path: "/wiki", redirect: "/recently", component: () => import("@/views/wiki"), children: [ { name: "recently", path: "/recently", title: "最近", icon: "time", meta: { parentActive: "wiki", }, component: () => import("@/views/wiki/recently"), }, { name: "mycollectiton", path: "/mycollectiton", title: "我的收藏", icon: "rate", meta: { parentActive: "wiki", }, component: () => import("@/views/wiki/mycollectiton"), }, { name: "share", path: "/share", title: "与我共享", icon: "redo", meta: { parentActive: "wiki", }, component: () => import("@/views/wiki/share"), }, { path: "/shareManage", redirect: "/shareManage/:knowledgeGroupId", children: [ { path: "/shareManage/:knowledgeGroupId", name: "shareManage", component: () => import("@/views/wiki/shareManage"), meta: { parentActive: "wiki", topActive: "share", }, }, ], }, { name: "pageGroup", path: "/pageGroup", title: "知识库", icon: "space", meta: { parentActive: "wiki", }, component: () => import("@/views/wiki/pageGroup"), }, { name: "insightOverview", path: "/insightOverview", title: "数据统计", icon: "monitor", meta: { parentActive: "wiki", }, component: () => import("@/views/wiki/insightOverview"), }, { path: "/pageGroupManage", redirect: "pageGroupManage", children: [ { path: "/pageGroupManage/:knowledgeGroupId", name: "pageGroupManage", component: () => import("@/views/wiki/pageGroupManage"), meta: { parentActive: "wiki", topActive: "pageGroup", }, }, ], }, { path: "/archiveManage", redirect: "/archiveManage/:knowledgeGroupId", children: [ { path: "/archiveManage/:knowledgeGroupId", name: "archiveManage", component: () => import("@/views/wiki/archiveManage"), meta: { parentActive: "wiki", topActive: "pageGroup", }, }, ], }, { path: "/pageGroupSet", redirect: "/pageGroupSet/:knowledgeGroupId", children: [ { path: "/pageGroupSet/:knowledgeGroupId", name: "pageGroupSet", component: () => import("@/views/wiki/pageGroupSet"), meta: { parentActive: "wiki", topActive: "pageGroup", }, }, ], }, { path: "/wikiHistory", redirect: "/wikiHistory/:knowledgeGroupId", children: [ { path: "/wikiHistory/:knowledgeGroupId", name: "wikiHistory", component: () => import("@/views/wiki/history"), meta: { parentActive: "wiki", topActive: "pageGroup", }, }, ], }, ], }, ], }, { path: "/rdLibrary", component: Layout, redirect: "/library", meta: { docTitle: "研发库", }, children: [ { name: "rdLibrary", path: "/rdLibrary", redirect: "/library", component: () => import("@/views/RdLibrary/index.vue"), children: [ { name: "library", path: "/library", component: () => import("@/views/RdLibrary/library/index.vue"), }, { name: "libraryContents", path: "/libraryContents", component: () => import("@/views/RdLibrary/library/contents.vue"), }, { name: "demandPoolLadger", path: "/demandPoolLadger", component: () => import("@/views/RdLibrary/components/demandPoolLadger.vue"), }, { name: "librarySettings", path: "/librarySettings", component: () => import("@/views/RdLibrary/library/librarySettings.vue"), }, ] } ], }, { path:"/Architecture", component: Layout, redirect: "/architecture", meta: { docTitle: "架构设计", }, children: [ { name: "architectureDesign", path: "/architectureDesign", component: () => import("@/views/architecture"), } ] }, { path: "/baselineManagements", component: Layout, redirect: "/baselinesManagement", meta: { docTitle: "基线管理", }, children: [ { name: "baselinesManagement", path: "/baselinesManagement", component: () => import("@/views/baselineManagement/index.vue"), } ], }, { path: "/HelpCenters", component: Layout, redirect: "/updateLog", meta: { docTitle: "帮助", }, children: [ { name: "HelpCenters", path: "/HelpCenters", redirect: "/updateLog", component: () => import("@/views/HelpCenters"), children: [ { name: "updateLog", path: "/updateLog", title: "更新日志", meta: { parentActive: "HelpCenters", }, component: () => import("@/views/HelpCenters/updateLog"), }, ], }, ], }, { path: "/configurationCenter", component: Layout, redirect: "/projectGroupMag", meta: { docTitle: "配置", }, children: [ { name: "configurationCenter", path: "/configurationCenter", redirect: "/projectGroupMag", component: () => import("@/views/configurationCenter"), children: [ { name: "MenuManagement", path: "/MenuManagement", meta: { parentActive: "configurationCenter", }, component: () => import("@/views/configurationCenter/MenuManagement"), }, { name: "UserManagement", path: "/UserManagement", meta: { parentActive: "configurationCenter", }, component: () => import("@/views/configurationCenter/UserManagement"), }, { name: "/userGroup", path: "/userGroup", meta: { parentActive: "configurationCenter", }, component: () => import("@/views/ugm"), }, { name: "departManagement", path: "/departManageMent", meta: { parentActive: "configurationCenter", }, component: () => import("@/views/dgm"), }, { name: "RoleManagement", path: "/RoleManagement", meta: { parentActive: "configurationCenter", }, component: () => import("@/views/configurationCenter/RoleManagement"), }, { name: "functionalSafety", path: "/functionalSafety", meta: { parentActive: "configurationCenter", }, component: () => import("@/views/securityConfig/functionalSafety"), }, { name: "WorkitemType", path: "/WorkitemType", meta: { parentActive: "configurationCenter", }, component: () => import("@/views/workitemConfig/workType"), }, { name: "Notification", path: "/WorkitemType/Notification", meta: { parentActive: "configurationCenter", }, component: () => import("@/views/workitemConfig/notification"), }, { name: "jiraSetting", path: "/jiraSetting", component: () => import("@/views/jiraSetting"), meta: { parentActive: "configurationCenter", }, }, { name: "WindowConfig", path: "/WindowConfig", meta: { parentActive: "configurationCenter", }, component: () => import("@/views/workitemConfig/workFrame"), }, { name: "ProcessDesign", path: "/ProcessDesign", meta: { parentActive: "configurationCenter", }, component: () => import("@/views/workitemConfig/workFlow"), }, { name: "ProjectM", path: "/ProjectM", meta: { parentActive: "configurationCenter", }, component: () => import("@/views/pm/proManaConfig/components/projectMag.vue"), }, { name: "projectGroupMag", path: "/projectGroupMag", meta: { parentActive: "configurationCenter", }, component: () => import("@/views/pm/proManaConfig/components/projectGroupMag"), }, { name: "projectAttribute", path: "/projectAttribute", meta: { parentActive: "configurationCenter", }, component: () => import("@/views/pm/proManaConfig/components/projectAttribute"), }, { name: "projectStatus", path: "/projectStatus", meta: { parentActive: "configurationCenter", }, component: () => import("@/views/pm/proManaConfig/components/projectStatus"), }, { name: "projectRole", path: "/projectRole", meta: { parentActive: "configurationCenter", }, component: () => import("@/views/pm/proManaConfig/components/projectRole"), }, { path: "/aclmanager", name: "aclmanager", props: (route) => ({ projectId: route.query.projectId || "-1" }), meta: { parentActive: "configurationCenter", }, component: () => import("@/views/workitemConfig/acl/index.vue"), // children: [{ // name: "aclmanager", // path: "/aclmanager", // component: () => import('@/views/workitemConfig/acl/index.vue') // }] }, { name: "TestPlanAttribute", path: "/TestPlanAttribute", meta: { parentActive: "configurationCenter", }, component: () => import("@/views/TestManagementConfig/TestPlanAttribute"), }, { name: "FileSizeConfig", path: "/FileSizeConfig", meta: { parentActive: "configurationCenter", }, component: () => import("@/views/fileConfig/fileInfoManage"), }, { name: "LoginLogs", path: "/LoginLogs", meta: { parentActive: "configurationCenter", }, component: () => import("@/views/logManagement/loginlogs"), }, { name: "ActionLogs", path: "/ActionLogs", meta: { parentActive: "configurationCenter", }, component: () => import("@/views/logManagement/actionlogs"), }, { name: "InterfaceLogs", path: "/InterfaceLogs", meta: { parentActive: "configurationCenter", }, component: () => import("@/views/logManagement/interfacelogs"), }, { name: "iterationAttribute", path: "/iterationAttribute", meta: { parentActive: "configurationCenter", }, component: () => import("@/views/pm/iterationAttributeConfig/iterationAttribute"), }, { name: "wikiPermissConfig", path: "/wikiPermissConfig", meta: { parentActive: "configurationCenter", }, component: () => import("@/views/wiki/wikiManaConfig/wikiPermissConfig"), }, { name: "wikiPageManage", path: "/wikiPageManage", meta: { parentActive: "configurationCenter", }, component: () => import("@/views/wiki/wikiManaConfig/wikiPageManage"), }, { name: "wikiInfoManage", path: "/wikiInfoManage", meta: { parentActive: "configurationCenter", }, component: () => import("@/views/wiki/wikiManaConfig/wikiInfoManage"), }, { name: "wikiTemplateManage", path: "/wikiTemplateManage", meta: { parentActive: "configurationCenter", }, component: () => import("@/views/wiki/wikiManaConfig/wikiTemplateManage"), }, { name: "templateList", path: "/templateList", meta: { parentActive: "configurationCenter", }, component: () => import("@/views/pm/reviewCenter/templateList"), }, { name: "formFlowEdit", path: "/formFlowEdit", meta: { parentActive: "configurationCenter", }, component: () => import( "@/views/pm/reviewCenter/formFlowEdit/FormProcessDesigner" ), }, { name: "componentManage", path: "/componentManage", meta: { parentActive: "configurationCenter", }, component: () => import("@/views/pm/reviewCenter/componentManage"), }, { name: "dataManage", path: "/dataManage", meta: { parentActive: "configurationCenter", }, component: () => import("@/views/pm/reviewCenter/dataManage"), }, { name: "dataStatistics", path: "/dataStatistics", meta: { parentActive: "configurationCenter", }, component: () => import("@/views/pm/reviewCenter/dataStatistics"), }, { name: "baseLineAttribute", path: "/baseLineAttribute", meta: { parentActive: "configurationCenter", }, component: () => import("@/views/pm/baseLineM/attribute.vue"), }, { name: "baseLineStatus", path: "/baseLineStatus", meta: { parentActive: "configurationCenter", }, component: () => import("@/views/pm/baseLineM/status.vue"), }, { name: "applicableCarType", // 适用车型 path: "/applicableCarType", meta: { parentActive: "configurationCenter", }, component: () => import("@/views/pm/reviewCenter/applicableConfig/applicableCarType"), }, { name: "applicableStage", // 适用阶段 path: "/applicableStage", meta: { parentActive: "configurationCenter", }, component: () => import("@/views/pm/reviewCenter/applicableConfig/applicableStage"), }, { name: "approvalSet", // 审批设置 path: "/approvalSet", meta: { parentActive: "configurationCenter", }, component: () => import("@/views/pm/reviewCenter/approvalSet"), }, { name: "ECUDataSet", // ECU主数据 path: "/ECUDataSet", meta: { parentActive: "configurationCenter", }, component: () => import("@/views/pm/reviewCenter/ECUDataSet"), }, { name: "ECUDataSet", // ECU主数据 path: "/ECUDataSet", meta: { parentActive: "configurationCenter", }, component: () => import("@/views/pm/reviewCenter/ECUDataSet"), }, { name: "ecuConfig", // data dictionary-ecu配置 path: "/ecuConfig", meta: { parentActive: "configurationCenter", }, component: () => import("@/views/pm/dataDictionary/ecu"), }, { name: "systemConfig", // 数据字典-系统配置 path: "/systemConfig", meta: { parentActive: "configurationCenter", }, component: () => import("@/views/pm/dataDictionary/system"), }, { name: "stageConfig", // 数据字典-阶段配置 path: "/stageConfig", meta: { parentActive: "configurationCenter", }, component: () => import("@/views/pm/dataDictionary/stage"), }, ], }, ], }, { path: "/workitem", component: Layout, redirect: "workitem", children: [ { name: "workitem", path: "/workitem", component: () => import("@/views/workitem"), }, ], }, { path: "/pm", component: Layout, redirect: "/projectManagement", meta: { docTitle: "项目", }, children: [ { name: "ProjectManagements", path: "/pm", redirect: "/projectManagement", //重定向的目标路径 component: () => import("@/views/pm/home"), children: [ { name: "ProjectManagements", path: "/projectManagement", title: "项目列表", // meta: { // parentActive: "myWorkbench", // }, component: () => import("@/views/pm/home/conmponents/projectManagement.vue"), }, ], }, ], }, { path: "/fileManagement", component: Layout, redirect: "/File", meta: { docTitle: "文件管理", }, children: [ { name: "File", path: "/File", title: "文件管理", component: () => import("_f/views/File.vue"), }, ], }, { path: "/office", name: "office", meta: { title: "在线编辑预览", content: { description: "onlyoffice 文档在线编辑预览,支持 Word Excel PowerPoint", }, }, component: () => import("@/views/QWFile/views/OnlyOffice.vue"), }, ]; const router = createRouter({ history: createWebHistory(), routes: [...constantRoutes, ...dynamicRoutes], scrollBehavior(to, from, savedPosition) { if (savedPosition) { return savedPosition; } return { top: 0 }; }, }); // 添加路由 export const resetRouter = (params) => { const dashboardRoute = router.options.routes.filter((el) => el?.path.indexOf("/dashboard") > -1) ?? []; const param = [...params, ...BasicRoute, ...dashboardRoute]; router.options.routes = []; router.options.routes.push(...param); // param.forEach((item) => { // router.addRoute(item); // }); }; // 生成路由 export const filterRoute = (rou) => { const permission = []; if (rou && Array.isArray(rou)) { rou.sort((a, b) => a.displayOrder - b.displayOrder); const forFn = (arr, val) => { // eslint-disable-next-line array-callback-return for (let i = 0; i < arr.length; i++) { // 跳过第一层非目录的数据 const item = arr[i]; if (item?.resourceType === 1 && item?.pid === "0") { continue; } item.name = item.routerName; item.path = item.routerAddress; try { // eslint-disable-next-line no-eval item.meta = JSON.parse(item.meta); item.meta.resourceName = item.resourceName; item.meta.resourceCode = item.resourceCode; } catch (e) { console.log(e); } // 处理菜单 if (item.resourceType !== 2) { item.meta.icon = item.icon || ""; item.meta.btncontent = []; if (item.meta.permission) { permission.push(item); } if (item.fileAddress) { item.component = modules[`/src/${item.fileAddress}/index.vue`]; item.componentString = `@/${item.fileAddress}`; } } if (item.resourceType === 2) { permission.push(item); val?.meta?.btncontent?.push({ icon: item.icon, btnName: item.resourceName, btnCode: item.resourceCode, }); if (val.meta?.list) { const child = val?.children?.find( (el) => el.resourceCode === item.resourceCode ); if (child) { child.meta.btncontent = []; child.meta.btncontent.push({ icon: item.icon, btnName: item.resourceName, btnCode: item.resourceCode, }); } } arr.splice(i--, 1); } if (item.children && Array.isArray(item.children)) { if (item.children.length > 0) { item.children.sort((a, b) => a.displayOrder - b.displayOrder); item.redirect = item.children.filter( (el) => el.resourceType === 1 )?.[0]?.routerAddress; forFn(item.children, item); } } } }; forFn(rou); } return { rou, permission }; }; router.beforeEach((to, from) => { // 如果是从 fileManager 页面离开 if (from.path.includes("/fileManager")) { emitter.emit("routeChange", { to, from }); } }); export default router;
最新发布
09-05
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值