From 092a79c1f122624c0c380d25f8a6440b4d9cc18f Mon Sep 17 00:00:00 2001 From: wenyann <64353056+wenyann@users.noreply.github.com> Date: Wed, 9 Dec 2020 16:48:57 +0800 Subject: [PATCH] =?UTF-8?q?feat(API):=20=E6=8E=A5=E5=8F=A3=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E6=96=B0=E6=97=A7=E7=89=88=E6=9C=AC=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/api/head/ApiHeaderMenus.vue | 47 ++++++++++--------- .../components/common/head/HeaderUser.vue | 23 +++++++-- frontend/src/business/store.js | 14 +++++- frontend/src/i18n/en-US.js | 2 + frontend/src/i18n/zh-CN.js | 4 +- frontend/src/i18n/zh-TW.js | 2 + 6 files changed, 65 insertions(+), 27 deletions(-) diff --git a/frontend/src/business/components/api/head/ApiHeaderMenus.vue b/frontend/src/business/components/api/head/ApiHeaderMenus.vue index 65420495e0..b2aebbfdf9 100644 --- a/frontend/src/business/components/api/head/ApiHeaderMenus.vue +++ b/frontend/src/business/components/api/head/ApiHeaderMenus.vue @@ -4,7 +4,8 @@ - + @@ -19,19 +20,20 @@ {{ $t("i18n.home") }} - + {{ $t("i18n.definition") }} - + {{ $t("i18n.automation") }} - + {{ $t("i18n.report") }} - + @@ -41,7 +43,8 @@ :title="$t('load_test.create')"/> - + @@ -49,7 +52,8 @@ - + {{ $t('commons.monitor') }} @@ -112,10 +116,11 @@ export default { apiTestProjectPath: '', } }, + watch: { '$route'(to) { this.init(); - } + }, }, methods: { registerEvents() { @@ -156,20 +161,20 @@ export default { diff --git a/frontend/src/business/components/common/head/HeaderUser.vue b/frontend/src/business/components/common/head/HeaderUser.vue index 0d5d0dbb74..e742dcd6c6 100644 --- a/frontend/src/business/components/common/head/HeaderUser.vue +++ b/frontend/src/business/components/common/head/HeaderUser.vue @@ -5,10 +5,16 @@ @@ -24,6 +30,11 @@ export default { name: "MsUser", components: {AboutUs}, + data() { + return { + isReadOnly: true + } + }, computed: { currentUser: () => { return getCurrentUser(); @@ -61,6 +72,10 @@ default: break; } + }, + changeBar(item) { + this.isReadOnly = !this.isReadOnly + this.$store.commit('setValue', item); } } } diff --git a/frontend/src/business/store.js b/frontend/src/business/store.js index eb11bb79ce..e90093754e 100644 --- a/frontend/src/business/store.js +++ b/frontend/src/business/store.js @@ -28,9 +28,21 @@ const API = { } } +const Switch = { + state: { + value: "new" + }, + mutations: { + setValue(state, value) { + state.value = value; + } + } +} + export default new Vuex.Store({ modules: { api: API, - common: Common + common: Common, + switch: Switch, } }) diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js index 8b08620ce3..df571e2b97 100644 --- a/frontend/src/i18n/en-US.js +++ b/frontend/src/i18n/en-US.js @@ -1,5 +1,7 @@ export default { commons: { + cut_back_old_version: 'Cut back to old version', + cut_back_new_version: 'Switch back to new version', comment: 'comment', examples: 'examples', help_documentation: 'Help documentation', diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index b61350a48a..987d798c0d 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -1,5 +1,7 @@ export default { commons: { + cut_back_old_version: '切回旧版', + cut_back_new_version: '切回新版', comment: '评论', examples: '示例', help_documentation: '帮助文档', @@ -278,7 +280,7 @@ export default { verified: '验证通过' } }, - project: { + edit: { recent: '最近的项目', create: '创建项目', edit: '编辑项目', diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js index 4578115771..1ef3cc4814 100644 --- a/frontend/src/i18n/zh-TW.js +++ b/frontend/src/i18n/zh-TW.js @@ -1,5 +1,7 @@ export default { commons: { + cut_back_old_version: '切回舊版', + cut_back_new_version: '切回新版', comment: '評論', examples: '示例', help_documentation: '幫助文檔',