From f3ff5b4180891caca682b352a5d89f0785d11d60 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Wed, 11 Oct 2023 18:26:25 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE):?= =?UTF-8?q?=20=E4=BC=98=E5=8C=96=E4=B8=8D=E6=98=BE=E7=A4=BA=E5=B7=A6?= =?UTF-8?q?=E4=BE=A7=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- system-setting/frontend/src/api/quota.js | 4 ++++ .../src/business/system/quota/QuotaList.vue | 17 +++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/system-setting/frontend/src/api/quota.js b/system-setting/frontend/src/api/quota.js index b8b549d070..7ab58472e4 100644 --- a/system-setting/frontend/src/api/quota.js +++ b/system-setting/frontend/src/api/quota.js @@ -47,3 +47,7 @@ export function deleteQuota(quota) { export function saveQuota(quota) { return post("/quota/save", quota); } + +export function getProjectModules(type, id) { + return get(`/quota/list/modules/${type}/${id}`); +} diff --git a/system-setting/frontend/src/business/system/quota/QuotaList.vue b/system-setting/frontend/src/business/system/quota/QuotaList.vue index 2c7bdaef31..4f6bd4558b 100644 --- a/system-setting/frontend/src/business/system/quota/QuotaList.vue +++ b/system-setting/frontend/src/business/system/quota/QuotaList.vue @@ -171,9 +171,9 @@ import QuotaValue from "./QuotaValue"; import MsTable from "metersphere-frontend/src/components/table/MsTable"; import MsTableColumn from "metersphere-frontend/src/components/table/MsTableColumn"; import {getCustomTableHeader, getCustomTableWidth} from "metersphere-frontend/src/utils/tableUtils"; -import {getCurrentWorkspaceId} from "metersphere-frontend/src/utils/token"; +import {getCurrentWorkspaceId, getCurrentProjectID} from "metersphere-frontend/src/utils/token"; import EditQuota from "./EditQuota"; -import {deleteQuota, getQuotaPages, saveQuota} from "../../../api/quota"; +import {deleteQuota, getQuotaPages, saveQuota, getProjectModules} from "../../../api/quota"; import {QUOTA_TABLE_HEADER_KEY, QUOTA_TYPE} from "../../../common/constants"; export default { @@ -316,6 +316,19 @@ export default { saveQuota(quota).then(() => { this.$success(this.$t("commons.save_success")); this.refresh(); + if (this.quotaType === QUOTA_TYPE.WORKSPACE) { + getProjectModules("workspace", getCurrentWorkspaceId()) + .then(res => { + let modules = res.data; + sessionStorage.setItem('workspace_modules', JSON.stringify(modules)); + }); + } else { + getProjectModules("project", getCurrentProjectID()) + .then(res => { + let modules = res.data; + sessionStorage.setItem('project_modules', JSON.stringify(modules)); + }); + } }).catch(() => { this.refresh(); });