Преглед изворни кода

fix: 用户管理 修复用户无角色/部门权限时禁用

jackhoo_98 пре 3 година
родитељ
комит
12d6852303
1 измењених фајлова са 4 додато и 2 уклоњено
  1. 4 2
      src/pages/system/User/Save/index.tsx

+ 4 - 2
src/pages/system/User/Save/index.tsx

@@ -331,9 +331,10 @@ const Save = (props: Props) => {
             'x-decorator': 'FormItem',
             'x-component': 'Select',
             'x-component-props': {
+              disabled: !rolePermission.view,
               mode: 'multiple',
               showArrow: true,
-              placeholder: '请选择角色',
+              placeholder: !rolePermission.view ? '暂无权限,请联系管理员' : '请选择角色',
               filterOption: (input: string, option: any) =>
                 option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0,
             },
@@ -373,9 +374,10 @@ const Save = (props: Props) => {
             'x-decorator': 'FormItem',
             'x-component': 'TreeSelect',
             'x-component-props': {
+              disabled: !deptPermission.view,
               multiple: true,
               showArrow: true,
-              placeholder: '请选择组织',
+              placeholder: !deptPermission.view ? '暂无权限,请联系管理员' : '请选择组织',
               showCheckedStrategy: ATreeSelect.SHOW_ALL,
               filterOption: (input: string, option: any) =>
                 option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0,