Commit d4fec7b6 authored by chenjianxing's avatar chenjianxing Committed by jianxing
Browse files

refactor: 更多操作按钮权限样式

parent d6c99740
Showing with 9 additions and 3 deletions
+9 -3
......@@ -114,16 +114,17 @@
},
{
label: this.$t('report.export'),
permissions: ['PROJECT_API_SCENARIO:READ+EXPORT_SCENARIO'],
children: [
{
label: this.$t('report.export_to_ms_format'),
permissions: ['PROJECT_API_SCENARIO:READ+EXPORT_SCENARIO'],
callback: () => {
this.$emit('exportAPI');
}
},
{
label: this.$t('report.export') + 'JMETER 格式',
permissions: ['PROJECT_API_SCENARIO:READ+EXPORT_SCENARIO'],
callback: () => {
this.$emit('exportJmx');
}
......
......@@ -74,10 +74,10 @@ export default {
},
{
label: this.$t('report.export'),
permissions: ['PROJECT_API_DEFINITION:READ+EXPORT_API'],
children: [
{
label: this.$t('report.export_to_ms_format'),
permissions: ['PROJECT_API_DEFINITION:READ+EXPORT_API'],
callback: () => {
if (!this.projectId) {
this.$warning(this.$t('commons.check_project_tip'));
......@@ -88,6 +88,7 @@ export default {
},
{
label: this.$t('report.export_to_swagger3_format'),
permissions: ['PROJECT_API_DEFINITION:READ+EXPORT_API'],
callback: () => {
if (!this.projectId) {
this.$warning(this.$t('commons.check_project_tip'));
......
......@@ -20,7 +20,8 @@
</span>
<el-dropdown-menu slot="dropdown">
<template>
<el-dropdown-item v-for="(child, index) in item.children" :key="index" @click.native.stop="click(child)">
<el-dropdown-item v-for="(child, index) in item.children" :key="index" @click.native.stop="click(child)"
:disabled="disabled(child.permissions)">
<span class="tip-font">
{{child.label}}
</span>
......@@ -68,6 +69,9 @@ export default {
}
},
disabled(permissions) {
if (!permissions) {
return false;
}
return !hasPermissions(...permissions);
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment