From a1ad901b409f8cceb61a3b393f30b469debd8b8c Mon Sep 17 00:00:00 2001 From: Bai Date: Fri, 28 May 2021 16:50:40 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=A7=BB=E5=8A=A8=20xpack/ChangeAuthPl?= =?UTF-8?q?an=20>=20accounts/CahngeAuthPlan?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/accounts.js | 41 +++++++++++++++++++ src/utils/common.js | 11 +++-- .../ChangeAuthPlanCreateUpdate.vue | 0 .../ChangeAuthPlanAsset/index.vue | 0 .../ChangeAuthPlanExecutionInfo.vue | 0 .../ChangeAuthPlanExecutionTaskList.vue | 0 .../ChangeAuthPlanExecutionDetail/index.vue | 0 .../ChangeAuthPlanExecutionList.vue | 0 .../ChangeAuthPlanInfo.vue | 0 .../ChangeAuthPlanDetail/index.vue | 0 .../ChangeAuthPlan/ChangeAuthPlanList.vue | 0 11 files changed, 48 insertions(+), 4 deletions(-) rename src/views/{xpack => accounts}/ChangeAuthPlan/ChangeAuthPlanCreateUpdate.vue (100%) rename src/views/{xpack => accounts}/ChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanAsset/index.vue (100%) rename src/views/{xpack => accounts}/ChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionDetail/ChangeAuthPlanExecutionInfo.vue (100%) rename src/views/{xpack => accounts}/ChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionDetail/ChangeAuthPlanExecutionTaskList.vue (100%) rename src/views/{xpack => accounts}/ChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionDetail/index.vue (100%) rename src/views/{xpack => accounts}/ChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionList.vue (100%) rename src/views/{xpack => accounts}/ChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanInfo.vue (100%) rename src/views/{xpack => accounts}/ChangeAuthPlan/ChangeAuthPlanDetail/index.vue (100%) rename src/views/{xpack => accounts}/ChangeAuthPlan/ChangeAuthPlanList.vue (100%) diff --git a/src/router/accounts.js b/src/router/accounts.js index 85b8eaa58..b2e9fb89a 100644 --- a/src/router/accounts.js +++ b/src/router/accounts.js @@ -82,5 +82,46 @@ export default [ hidden: true } ] + }, + { + path: 'change-auth-plan', + component: empty, + meta: { title: i18n.t('xpack.ChangeAuthPlan.ChangeAuthPlan'), activeMenu: '/accounts/change-auth-plan/plan' }, + children: [ + { + path: 'plan', + component: () => import('@/views/accounts/ChangeAuthPlan/ChangeAuthPlanList.vue'), + name: 'ChangeAuthPlanList', + meta: { title: i18n.t('xpack.ChangeAuthPlan.ChangeAuthPlan'), activeMenu: '/accounts/change-auth-plan/plan' } + }, + { + path: 'plan/create', + component: () => import('@/views/accounts/ChangeAuthPlan/ChangeAuthPlanCreateUpdate.vue'), + name: 'ChangeAuthPlanCreate', + meta: { title: i18n.t('xpack.ChangeAuthPlan.ChangeAuthPlanCreate'), activeMenu: '/accounts/change-auth-plan/plan', action: 'create' }, + hidden: true + }, + { + path: 'plan/:id/update', + component: () => import('@/views/accounts/ChangeAuthPlan/ChangeAuthPlanCreateUpdate.vue'), + name: 'ChangeAuthPlanUpdate', + meta: { title: i18n.t('xpack.ChangeAuthPlan.ChangeAuthPlanUpdate'), activeMenu: '/accounts/change-auth-plan/plan', action: 'update' }, + hidden: true + }, + { + path: 'plan/:id', + component: () => import('@/views/accounts/ChangeAuthPlan/ChangeAuthPlanDetail/index.vue'), + name: 'ChangeAuthPlanDetail', + meta: { title: i18n.t('xpack.ChangeAuthPlan.ChangeAuthPlan'), activeMenu: '/accounts/change-auth-plan/plan' }, + hidden: true + }, + { + path: 'plan-execution/:id', + component: () => import('@/views/accounts/ChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionDetail/index.vue'), + name: 'ChangeAuthPlanExecutionDetail', + meta: { title: i18n.t('xpack.ChangeAuthPlan.ExecutionDetail'), activeMenu: '/accounts/change-auth-plan/plan' }, + hidden: true + } + ] } ] diff --git a/src/utils/common.js b/src/utils/common.js index bc67400d5..65b2ca79c 100644 --- a/src/utils/common.js +++ b/src/utils/common.js @@ -88,11 +88,14 @@ export function toSafeLocalDateStr(d) { } export function getApiPath(that) { - const pagePath = that.$route.path - const isOrgPath = pagePath.split('/').indexOf('orgs') !== -1 - if (isOrgPath) { - return `/api/v1/orgs/orgs/${pagePath.split('/').pop()}/` + let pagePath = that.$route.path + const pagePathArray = pagePath.split('/') + if (pagePathArray.indexOf('orgs') !== -1) { + pagePathArray[pagePathArray.indexOf('xpack')] = 'orgs' + } else if (pagePathArray.indexOf('gathered-user') !== -1 || pagePathArray.indexOf('change-auth-plan') !== -1) { + pagePathArray[pagePathArray.indexOf('accounts')] = 'xpack' } + pagePath = pagePathArray.join('/') return `/api/v1${pagePath}/` } diff --git a/src/views/xpack/ChangeAuthPlan/ChangeAuthPlanCreateUpdate.vue b/src/views/accounts/ChangeAuthPlan/ChangeAuthPlanCreateUpdate.vue similarity index 100% rename from src/views/xpack/ChangeAuthPlan/ChangeAuthPlanCreateUpdate.vue rename to src/views/accounts/ChangeAuthPlan/ChangeAuthPlanCreateUpdate.vue diff --git a/src/views/xpack/ChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanAsset/index.vue b/src/views/accounts/ChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanAsset/index.vue similarity index 100% rename from src/views/xpack/ChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanAsset/index.vue rename to src/views/accounts/ChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanAsset/index.vue diff --git a/src/views/xpack/ChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionDetail/ChangeAuthPlanExecutionInfo.vue b/src/views/accounts/ChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionDetail/ChangeAuthPlanExecutionInfo.vue similarity index 100% rename from src/views/xpack/ChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionDetail/ChangeAuthPlanExecutionInfo.vue rename to src/views/accounts/ChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionDetail/ChangeAuthPlanExecutionInfo.vue diff --git a/src/views/xpack/ChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionDetail/ChangeAuthPlanExecutionTaskList.vue b/src/views/accounts/ChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionDetail/ChangeAuthPlanExecutionTaskList.vue similarity index 100% rename from src/views/xpack/ChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionDetail/ChangeAuthPlanExecutionTaskList.vue rename to src/views/accounts/ChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionDetail/ChangeAuthPlanExecutionTaskList.vue diff --git a/src/views/xpack/ChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionDetail/index.vue b/src/views/accounts/ChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionDetail/index.vue similarity index 100% rename from src/views/xpack/ChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionDetail/index.vue rename to src/views/accounts/ChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionDetail/index.vue diff --git a/src/views/xpack/ChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionList.vue b/src/views/accounts/ChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionList.vue similarity index 100% rename from src/views/xpack/ChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionList.vue rename to src/views/accounts/ChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionList.vue diff --git a/src/views/xpack/ChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanInfo.vue b/src/views/accounts/ChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanInfo.vue similarity index 100% rename from src/views/xpack/ChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanInfo.vue rename to src/views/accounts/ChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanInfo.vue diff --git a/src/views/xpack/ChangeAuthPlan/ChangeAuthPlanDetail/index.vue b/src/views/accounts/ChangeAuthPlan/ChangeAuthPlanDetail/index.vue similarity index 100% rename from src/views/xpack/ChangeAuthPlan/ChangeAuthPlanDetail/index.vue rename to src/views/accounts/ChangeAuthPlan/ChangeAuthPlanDetail/index.vue diff --git a/src/views/xpack/ChangeAuthPlan/ChangeAuthPlanList.vue b/src/views/accounts/ChangeAuthPlan/ChangeAuthPlanList.vue similarity index 100% rename from src/views/xpack/ChangeAuthPlan/ChangeAuthPlanList.vue rename to src/views/accounts/ChangeAuthPlan/ChangeAuthPlanList.vue