From 4b7933a85d8b8b9c926fc773e95c40cc02f21512 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Tue, 23 Mar 2021 15:49:24 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E9=87=8D=E6=9E=84vuex?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/api/head/ApiHeaderMenus.vue | 23 +++--- .../components/common/head/HeaderTopMenus.vue | 11 ++- .../components/common/head/HeaderUser.vue | 16 +++-- .../components/common/head/SearchList.vue | 9 ++- .../performance/test/EditPerformanceTest.vue | 2 +- .../components/track/home/TrackHome.vue | 4 +- frontend/src/business/main.js | 2 +- frontend/src/business/store.js | 72 ------------------- frontend/src/store/actions.js | 6 ++ frontend/src/store/getters.js | 6 ++ frontend/src/store/index.js | 25 +++++++ frontend/src/store/mutations.js | 9 +++ 12 files changed, 90 insertions(+), 95 deletions(-) delete mode 100644 frontend/src/business/store.js create mode 100644 frontend/src/store/actions.js create mode 100644 frontend/src/store/getters.js create mode 100644 frontend/src/store/index.js create mode 100644 frontend/src/store/mutations.js diff --git a/frontend/src/business/components/api/head/ApiHeaderMenus.vue b/frontend/src/business/components/api/head/ApiHeaderMenus.vue index 982ecc1960..68275d6e10 100644 --- a/frontend/src/business/components/api/head/ApiHeaderMenus.vue +++ b/frontend/src/business/components/api/head/ApiHeaderMenus.vue @@ -5,26 +5,26 @@ - + {{ $t("i18n.home") }} - + {{ $t("i18n.home") }} - + {{ $t("i18n.definition") }} - + {{ $t("i18n.automation") }} - + {{ $t("i18n.report") }} - @@ -35,7 +35,7 @@ :title="$t('load_test.create')"/> - @@ -44,7 +44,7 @@ - {{ $t('commons.monitor') }} @@ -64,6 +64,7 @@ import MsCreateTest from "../../common/head/CreateTest"; import {ApiEvent, LIST_CHANGE} from "@/business/components/common/head/ListEvent"; import SearchList from "@/business/components/common/head/SearchList"; import ProjectChange from "@/business/components/common/head/ProjectSwitch"; +import {mapGetters} from "vuex"; export default { name: "MsApiHeaderMenus", @@ -94,6 +95,12 @@ export default { currentProject: '' } }, + computed: { + ...mapGetters([ + 'isNewVersion', + 'isOldVersion', + ]) + }, methods: { registerEvents() { ApiEvent.$on(LIST_CHANGE, () => { diff --git a/frontend/src/business/components/common/head/HeaderTopMenus.vue b/frontend/src/business/components/common/head/HeaderTopMenus.vue index 7f2cc6056c..8d559d0e94 100644 --- a/frontend/src/business/components/common/head/HeaderTopMenus.vue +++ b/frontend/src/business/components/common/head/HeaderTopMenus.vue @@ -30,6 +30,7 @@