fix(项目设置): 模板管理新增权限不足提示

--bug=1027187 --user=王旭 【项目设置】项目成员有缺陷模版权限,创建缺陷模版报403 https://www.tapd.cn/55049933/s/1386290
This commit is contained in:
WangXu10 2023-06-26 19:08:23 +08:00 committed by jianxing
parent a007181d9e
commit ac1bd098a4
4 changed files with 10 additions and 2 deletions

View File

@ -35,11 +35,12 @@
<slot></slot>
<el-form-item :label="$t('table.selected_fields')" class="filed-list" :label-width="labelWidth">
<el-button type="primary" @click="relateField">{{ $t('custom_field.add_field') }}</el-button>
<el-button plain type="primary" @click="addField">{{
<el-button :disabled="!hasPermissions" type="primary" @click="relateField">{{ $t('custom_field.add_field') }}</el-button>
<el-button :disabled="!hasPermissions" plain type="primary" @click="addField">{{
$t('custom_field.custom_field_setting')
}}
</el-button>
<span v-if="!hasPermissions" style="font-size: 12px; color: red; margin-left: 10px">{{$t("custom_field.no_custom_fields_permission")}}</span>
</el-form-item>
<el-form-item :label-width="labelWidth">
@ -82,6 +83,7 @@ import CustomFieldRelateList from "@/business/components/project/template/Custom
import {getCurrentProjectID} from "@/common/js/utils";
import CustomFieldEdit from "@/business/components/project/template/CustomFieldEdit";
import {generateTableHeaderKey, getCustomFieldsKeys} from "@/common/js/tableUtils";
import {hasPermissions} from "@/common/js/utils";
export default {
name: "FieldTemplateEdit",
@ -121,6 +123,9 @@ export default {
computed: {
isSystem() {
return this.form.system;
},
hasPermissions() {
return hasPermissions('PROJECT_TEMPLATE:READ+CUSTOM');
}
},
methods: {

View File

@ -559,6 +559,7 @@ export default {
field_text: 'Field Text',
field_value: 'Field ID',
add_field: 'Add Field',
no_custom_fields_permission: '(Missing custom field permissions, Please contact the administrator for configuration!)',
api_field_name: 'API Field Name',
template_setting: 'Template Setting',
custom_field_setting: 'Custom Field Setting',

View File

@ -561,6 +561,7 @@ export default {
field_text: '选项内容',
field_value: '选项ID',
add_field: '添加字段',
no_custom_fields_permission: '(缺少自定义字段权限,请联系管理员进行配置!',
api_field_name: 'API字段名',
template_setting: '模板设置',
custom_field_setting: '设置自定义字段',

View File

@ -561,6 +561,7 @@ export default {
field_text: '選項內容',
field_value: '選項ID',
add_field: '添加字段',
no_custom_fields_permission: '(缺少自定義字段權限,請聯係管理員進行配置!)',
api_field_name: 'API字段名',
template_setting: '模板設置',
custom_field_setting: '設置自定義字段',