From 607a8bc8ea1536f268e92f8b55a567296fb25fa9 Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Mon, 11 Oct 2021 14:58:48 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=88=A0=E9=99=A4=E6=97=A7?= =?UTF-8?q?=E7=89=88api=E7=9A=84=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/api/head/ApiHeaderMenus.vue | 41 +- .../api/home/ApiReportRecentList.vue | 77 ---- .../components/api/home/ApiTestHome.vue | 72 --- .../components/api/home/ApiTestRecentList.vue | 72 --- .../src/business/components/api/router.js | 24 +- .../components/api/test/ApiReportDialog.vue | 79 ---- .../components/api/test/ApiTestConfig.vue | 423 ------------------ .../components/api/test/ApiTestList.vue | 231 ---------- .../components/api/test/ApiTestStatus.vue | 38 -- .../components/api/test/OneClickOperation.vue | 205 --------- .../business/components/api/test/Upgrade.vue | 198 -------- .../components/common/head/HeaderTopMenus.vue | 12 +- .../components/common/head/HeaderUser.vue | 4 - .../components/common/head/SearchList.vue | 6 - frontend/src/store/getters.js | 2 - 15 files changed, 8 insertions(+), 1476 deletions(-) delete mode 100644 frontend/src/business/components/api/home/ApiReportRecentList.vue delete mode 100644 frontend/src/business/components/api/home/ApiTestHome.vue delete mode 100644 frontend/src/business/components/api/home/ApiTestRecentList.vue delete mode 100644 frontend/src/business/components/api/test/ApiReportDialog.vue delete mode 100644 frontend/src/business/components/api/test/ApiTestConfig.vue delete mode 100644 frontend/src/business/components/api/test/ApiTestList.vue delete mode 100644 frontend/src/business/components/api/test/ApiTestStatus.vue delete mode 100644 frontend/src/business/components/api/test/OneClickOperation.vue delete mode 100644 frontend/src/business/components/api/test/Upgrade.vue diff --git a/frontend/src/business/components/api/head/ApiHeaderMenus.vue b/frontend/src/business/components/api/head/ApiHeaderMenus.vue index ffab8485d2..b3ff085730 100644 --- a/frontend/src/business/components/api/head/ApiHeaderMenus.vue +++ b/frontend/src/business/components/api/head/ApiHeaderMenus.vue @@ -5,47 +5,20 @@ - + {{ $t("i18n.home") }} - - {{ $t("i18n.home") }} - - - + {{ $t("i18n.definition") }} - + {{ $t("i18n.automation") }} - + {{ $t("i18n.report") }} - - - - - - - - - - - - - - - - - - - - {{ $t('commons.monitor') }} - @@ -92,12 +65,6 @@ export default { currentProject: '' }; }, - computed: { - ...mapGetters([ - 'isNewVersion', - 'isOldVersion', - ]) - }, methods: { reload() { this.isRouterAlive = false; diff --git a/frontend/src/business/components/api/home/ApiReportRecentList.vue b/frontend/src/business/components/api/home/ApiReportRecentList.vue deleted file mode 100644 index 188124fa5e..0000000000 --- a/frontend/src/business/components/api/home/ApiReportRecentList.vue +++ /dev/null @@ -1,77 +0,0 @@ - - - - - diff --git a/frontend/src/business/components/api/home/ApiTestHome.vue b/frontend/src/business/components/api/home/ApiTestHome.vue deleted file mode 100644 index 69919d5c8a..0000000000 --- a/frontend/src/business/components/api/home/ApiTestHome.vue +++ /dev/null @@ -1,72 +0,0 @@ - - - - - diff --git a/frontend/src/business/components/api/home/ApiTestRecentList.vue b/frontend/src/business/components/api/home/ApiTestRecentList.vue deleted file mode 100644 index 722afac12b..0000000000 --- a/frontend/src/business/components/api/home/ApiTestRecentList.vue +++ /dev/null @@ -1,72 +0,0 @@ - - - - - diff --git a/frontend/src/business/components/api/router.js b/frontend/src/business/components/api/router.js index 6abb580c13..7f28247e01 100644 --- a/frontend/src/business/components/api/router.js +++ b/frontend/src/business/components/api/router.js @@ -1,5 +1,3 @@ -import MsProject from "@/business/components/settings/workspace/MsProject"; - export default { path: "/api", name: "api", @@ -13,22 +11,6 @@ export default { name: 'fucHome', component: () => import('@/business/components/api/homepage/ApiTestHomePage'), }, - { - path: 'home_obsolete', - name: 'fucHome', - component: () => import('@/business/components/api/home/ApiTestHome'), - }, - { - path: "test/:type", - name: "ApiTestConfig", - component: () => import('@/business/components/api/test/ApiTestConfig'), - props: (route) => ({id: route.query.id}) - }, - { - path: "test/list/:projectId", - name: "ApiTestList", - component: () => import('@/business/components/api/test/ApiTestList'), - }, // { // path: "project/:type", // name: "fucProject", @@ -50,8 +32,8 @@ export default { component: () => import('@/business/components/api/automation/report/ApiReportList'), }, { - path:"automation/report/view/:reportId", - name:"ApiReportView", + path: "automation/report/view/:reportId", + name: "ApiReportView", component: () => import('@/business/components/api/automation/report/ApiReportView'), }, @@ -71,4 +53,4 @@ export default { component: () => import('@/business/components/api/monitor/ApiMonitor'), }, ] -} +}; diff --git a/frontend/src/business/components/api/test/ApiReportDialog.vue b/frontend/src/business/components/api/test/ApiReportDialog.vue deleted file mode 100644 index cf6cc09305..0000000000 --- a/frontend/src/business/components/api/test/ApiReportDialog.vue +++ /dev/null @@ -1,79 +0,0 @@ - - - - - diff --git a/frontend/src/business/components/api/test/ApiTestConfig.vue b/frontend/src/business/components/api/test/ApiTestConfig.vue deleted file mode 100644 index a45acac51c..0000000000 --- a/frontend/src/business/components/api/test/ApiTestConfig.vue +++ /dev/null @@ -1,423 +0,0 @@ - - - - - diff --git a/frontend/src/business/components/api/test/ApiTestList.vue b/frontend/src/business/components/api/test/ApiTestList.vue deleted file mode 100644 index 7171b835b0..0000000000 --- a/frontend/src/business/components/api/test/ApiTestList.vue +++ /dev/null @@ -1,231 +0,0 @@ - - - - - diff --git a/frontend/src/business/components/api/test/ApiTestStatus.vue b/frontend/src/business/components/api/test/ApiTestStatus.vue deleted file mode 100644 index 2d0bf24331..0000000000 --- a/frontend/src/business/components/api/test/ApiTestStatus.vue +++ /dev/null @@ -1,38 +0,0 @@ - - - - - diff --git a/frontend/src/business/components/api/test/OneClickOperation.vue b/frontend/src/business/components/api/test/OneClickOperation.vue deleted file mode 100644 index e3950d3588..0000000000 --- a/frontend/src/business/components/api/test/OneClickOperation.vue +++ /dev/null @@ -1,205 +0,0 @@ - - - - - diff --git a/frontend/src/business/components/api/test/Upgrade.vue b/frontend/src/business/components/api/test/Upgrade.vue deleted file mode 100644 index 3382cde18f..0000000000 --- a/frontend/src/business/components/api/test/Upgrade.vue +++ /dev/null @@ -1,198 +0,0 @@ - - - - - diff --git a/frontend/src/business/components/common/head/HeaderTopMenus.vue b/frontend/src/business/components/common/head/HeaderTopMenus.vue index 15ce42db27..e13b26bd36 100644 --- a/frontend/src/business/components/common/head/HeaderTopMenus.vue +++ b/frontend/src/business/components/common/head/HeaderTopMenus.vue @@ -82,23 +82,13 @@ export default { this.registerEvents(); }, - computed: { - ...mapGetters([ - 'isNewVersion', - 'isOldVersion', - ]) - }, methods: { handleSelect(index) { this.activeIndex = index; }, active() { if (this.activeIndex === '/api') { - if (this.isNewVersion) { - window.location.href = "/#/api/home"; - } else if (this.isOldVersion) { - window.location.href = "/#/api/home_obsolete"; - } + window.location.href = "/#/api/home"; } }, check(key) { diff --git a/frontend/src/business/components/common/head/HeaderUser.vue b/frontend/src/business/components/common/head/HeaderUser.vue index c084414b9d..6e25e29248 100644 --- a/frontend/src/business/components/common/head/HeaderUser.vue +++ b/frontend/src/business/components/common/head/HeaderUser.vue @@ -39,10 +39,6 @@ export default { currentUser: () => { return getCurrentUser(); }, - ...mapGetters([ - 'isNewVersion', - 'isOldVersion', - ]) }, methods: { logout: function () { diff --git a/frontend/src/business/components/common/head/SearchList.vue b/frontend/src/business/components/common/head/SearchList.vue index 6bc6997f88..30a7e4acaf 100644 --- a/frontend/src/business/components/common/head/SearchList.vue +++ b/frontend/src/business/components/common/head/SearchList.vue @@ -49,12 +49,6 @@ export default { inject: [ 'reload' ], - computed: { - ...mapGetters([ - 'isNewVersion', - 'isOldVersion', - ]), - }, data() { return { result: {}, diff --git a/frontend/src/store/getters.js b/frontend/src/store/getters.js index f4604b7d16..2ae981407b 100644 --- a/frontend/src/store/getters.js +++ b/frontend/src/store/getters.js @@ -1,6 +1,4 @@ const getters = { - isNewVersion: state => state.versionSwitch === 'new', - isOldVersion: state => state.versionSwitch === 'old', // getTestCaseNodePath(state, nodeId) { // for (const index in state.moduleOptions) { // let item = state.moduleOptions[index];