refactor(系统设置): 优化不显示左侧模块
This commit is contained in:
parent
fda0ce7f47
commit
f3ff5b4180
|
@ -47,3 +47,7 @@ export function deleteQuota(quota) {
|
||||||
export function saveQuota(quota) {
|
export function saveQuota(quota) {
|
||||||
return post("/quota/save", quota);
|
return post("/quota/save", quota);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getProjectModules(type, id) {
|
||||||
|
return get(`/quota/list/modules/${type}/${id}`);
|
||||||
|
}
|
||||||
|
|
|
@ -171,9 +171,9 @@ import QuotaValue from "./QuotaValue";
|
||||||
import MsTable from "metersphere-frontend/src/components/table/MsTable";
|
import MsTable from "metersphere-frontend/src/components/table/MsTable";
|
||||||
import MsTableColumn from "metersphere-frontend/src/components/table/MsTableColumn";
|
import MsTableColumn from "metersphere-frontend/src/components/table/MsTableColumn";
|
||||||
import {getCustomTableHeader, getCustomTableWidth} from "metersphere-frontend/src/utils/tableUtils";
|
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 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";
|
import {QUOTA_TABLE_HEADER_KEY, QUOTA_TYPE} from "../../../common/constants";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -316,6 +316,19 @@ export default {
|
||||||
saveQuota(quota).then(() => {
|
saveQuota(quota).then(() => {
|
||||||
this.$success(this.$t("commons.save_success"));
|
this.$success(this.$t("commons.save_success"));
|
||||||
this.refresh();
|
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(() => {
|
}).catch(() => {
|
||||||
this.refresh();
|
this.refresh();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue