Browse Source

feat: 增加人资-通知中心的角色权限设置

lanjianrong 3 years ago
parent
commit
8239f79d52
1 changed files with 28 additions and 0 deletions
  1. 28 0
      src/pages/Role/Hr/index.tsx

+ 28 - 0
src/pages/Role/Hr/index.tsx

@@ -231,6 +231,34 @@ const Hr = () => {
                         />
                       )}
                     </ProFormDependency>
+                    <ProFormSwitch
+                      fieldProps={{
+                        onChange(checked) {
+                          if (!checked) {
+                            formRef.current?.setFieldsValue({ notification: [] })
+                          }
+                        }
+                      }}
+                      name="showNotification"
+                      label={
+                        <span className="flex items-center">
+                          <EveryUser className="mr-1" className="flex items-baseline mr-1" />
+                          通知中心
+                        </span>
+                      }
+                    />
+                    <ProFormDependency name={['showNotification']}>
+                      {({ showNotification }) => (
+                        <ProFormCheckbox.Group
+                          wrapperCol={{ offset: 1 }}
+                          name="notification"
+                          options={[
+                            { value: 'access', label: '查看', disabled: !showNotification },
+                            { value: 'add', label: '添加', disabled: !showNotification }
+                          ]}
+                        />
+                      )}
+                    </ProFormDependency>
                   </ProForm>
                 )}
               </div>