diff --git a/frontend/src/router/routes/modules/share.ts b/frontend/src/router/routes/modules/share.ts index c9b1f45127..2d8b417e57 100644 --- a/frontend/src/router/routes/modules/share.ts +++ b/frontend/src/router/routes/modules/share.ts @@ -8,11 +8,9 @@ const ShareRoute: AppRouteRecordRaw = { name: ShareEnum.SHARE, component: SHARE_LAYOUT, meta: { - locale: 'menu.testPlan', - icon: 'icon-icon_test-tracking_filled', - hideChildrenInMenu: true, - roles: ['*'], hideInMenu: true, + roles: ['*'], + requiresAuth: true, }, children: [ // 测试计划 diff --git a/frontend/src/utils/index.ts b/frontend/src/utils/index.ts index 5816a6cb0e..4e31574d7b 100644 --- a/frontend/src/utils/index.ts +++ b/frontend/src/utils/index.ts @@ -895,3 +895,23 @@ export function addLevelToTree(tree: TreeNode[], level = 0): TreeNode[] return newNode; }); } +/** + * 时间转换单位 + * @param ms 目标时间时间 + */ +export function formatDuration(ms: number) { + // 将毫秒转换为秒 + const seconds = ms / 1000; + // 如果小于1秒,则直接返回毫秒 + if (seconds < 1) return `${ms}-ms`; + // 如果小于60秒,则返回秒 + if (seconds < 60) return `${seconds}-sec`; + // 将秒转换为分钟 + const minutes = seconds / 60; + // 如果小于60分钟,则返回分钟 + if (minutes < 60) return `${minutes.toFixed(1)}-min`; + // 将分钟转换为小时 + const hours = minutes / 60; + // 返回小时 + return `${hours.toFixed(1)}-hr`; +} diff --git a/frontend/src/views/api-test/components/requestComposition/response/result/tiledDisplay.vue b/frontend/src/views/api-test/components/requestComposition/response/result/tiledDisplay.vue index c905b7baab..9a4b54e6f8 100644 --- a/frontend/src/views/api-test/components/requestComposition/response/result/tiledDisplay.vue +++ b/frontend/src/views/api-test/components/requestComposition/response/result/tiledDisplay.vue @@ -3,10 +3,10 @@