fix(性能测试): 创建测试添加编辑权限校验提示

--bug=1027188 --user=宋昌昌 【性能测试】项目成员勾选创建性能测试权限,创建测试页面置灰 https://www.tapd.cn/55049933/s/1383671
This commit is contained in:
song-cc-rock 2023-06-20 11:35:13 +08:00 committed by 刘瑞斌
parent e21ea99dab
commit 14dc4b664b
4 changed files with 11 additions and 3 deletions

View File

@ -142,6 +142,7 @@ import {
} from "@/api/performance"; } from "@/api/performance";
import {getProjectVersions, isProjectVersionEnable} from "metersphere-frontend/src/api/version"; import {getProjectVersions, isProjectVersionEnable} from "metersphere-frontend/src/api/version";
import {hasPermission} from "metersphere-frontend/src/utils/permission"
export default { export default {
components: { components: {
@ -375,6 +376,10 @@ export default {
this.$warning(this.$t('commons.check_project_tip')); this.$warning(this.$t('commons.check_project_tip'));
return; return;
} }
if (!hasPermission('PROJECT_PERFORMANCE_TEST:READ+EDIT')) {
this.$warning(this.$t('performance_test.edit_performance_test_tips'));
return;
}
this.$router.push('/performance/test/create'); this.$router.push('/performance/test/create');
}, },
getVersionOptions(currentVersion) { getVersionOptions(currentVersion) {

View File

@ -10,7 +10,8 @@ const message = {
}, },
max_current_threads_tips: 'Exceeded the maximum concurrent number of this node {0}', max_current_threads_tips: 'Exceeded the maximum concurrent number of this node {0}',
sync_scenario_no_permission_tips: 'No permission to create the scenario cannot perform synchronization', sync_scenario_no_permission_tips: 'No permission to create the scenario cannot perform synchronization',
basic_config_file_limit_tip: 'Note: The maximum number of resource files is limited to 10' basic_config_file_limit_tip: 'Note: The maximum number of resource files is limited to 10',
edit_performance_test_tips: 'No permission to edit test, please check it before operation'
} }
} }
export default { export default {

View File

@ -10,7 +10,8 @@ const message = {
}, },
max_current_threads_tips: '超出此节点{0}最大并发数', max_current_threads_tips: '超出此节点{0}最大并发数',
sync_scenario_no_permission_tips: '没有创建接口的权限无法执行同步', sync_scenario_no_permission_tips: '没有创建接口的权限无法执行同步',
basic_config_file_limit_tip: '注资源文件数最大限制为10个' basic_config_file_limit_tip: '注资源文件数最大限制为10个',
edit_performance_test_tips: '没有编辑性能测试的权限,请勾选后再操作'
} }
} }

View File

@ -10,7 +10,8 @@ const message = {
}, },
max_current_threads_tips: '超出此節點{0}最大並發數', max_current_threads_tips: '超出此節點{0}最大並發數',
sync_scenario_no_permission_tips: '沒有创建接口的權限無法執行同步', sync_scenario_no_permission_tips: '沒有创建接口的權限無法執行同步',
basic_config_file_limit_tip: '注資源文件數最大限制為10個' basic_config_file_limit_tip: '注資源文件數最大限制為10個',
edit_performance_test_tips: '沒有編輯性能測試的權限,請勾選後再操作'
} }
} }