소스 검색

fix: Merge branch next-hub into next

jackhoo_98 3 년 전
부모
커밋
e1f21ef479
3개의 변경된 파일62개의 추가작업 그리고 7개의 파일을 삭제
  1. 57 3
      src/pages/link/Type/Detail/index.tsx
  2. 3 0
      src/pages/system/Menu/Detail/buttons.tsx
  3. 2 4
      src/pages/system/User/Save/index.tsx

+ 57 - 3
src/pages/link/Type/Detail/index.tsx

@@ -467,9 +467,33 @@ const Save = observer(() => {
             'x-component-props': {
               placeholder: '请输入远程端口',
             },
-            required: true,
             'x-decorator': 'FormItem',
             'x-component': 'NumberPicker',
+            'x-validator': [
+              {
+                max: 65535,
+                message: '请输入0-65535之间的正整数',
+              },
+              {
+                min: 0,
+                message: '请输入0-65535之间的正整数',
+              },
+              {
+                required: true,
+                placeholder: '请输入远程端口',
+              },
+              {
+                validator: (value: any[]) => {
+                  return new Promise((resolve) => {
+                    if (/[.]/.test(value)) {
+                      resolve('请输入1-65535之间的正整数');
+                    } else {
+                      resolve('');
+                    }
+                  });
+                },
+              },
+            ],
           },
           clientId: {
             title: 'clientId',
@@ -481,9 +505,18 @@ const Save = observer(() => {
             'x-component-props': {
               placeholder: '请输入ClientId',
             },
-            required: true,
             'x-decorator': 'FormItem',
             'x-component': 'Input',
+            'x-validator': [
+              {
+                max: 64,
+                message: '最多可输入64个字符',
+              },
+              {
+                required: true,
+                placeholder: '请输入ClientId',
+              },
+            ],
           },
           username: {
             title: '用户名',
@@ -541,13 +574,20 @@ const Save = observer(() => {
             },
             'x-decorator': 'FormItem',
             'x-component': 'Input',
+            'x-validator': [
+              {
+                max: 64,
+                message: '最多可输入64个字符',
+              },
+            ],
           },
         },
       },
       maxMessageSize: {
         title: '最大消息长度',
         'x-decorator': 'FormItem',
-        'x-component': 'Input',
+        'x-component': 'NumberPicker',
+        default: 8192,
         'x-decorator-props': {
           gridSpan: 1,
           labelAlign: 'left',
@@ -567,6 +607,20 @@ const Save = observer(() => {
             },
           },
         },
+        'x-validator': [
+          {
+            max: 1073741824,
+            message: '请输入1024~1073741824之间的数字',
+          },
+          {
+            min: 1024,
+            message: '请输入1024~1073741824之间的数字',
+          },
+          {
+            required: true,
+            placeholder: '请输入最大消息长度',
+          },
+        ],
       },
       secure: {
         // title: '开启DTLS',

+ 3 - 0
src/pages/system/Menu/Detail/buttons.tsx

@@ -146,6 +146,7 @@ export default (props: ButtonsProps) => {
       }),
       width: 220,
       dataIndex: 'id',
+      ellipsis: true,
     },
     {
       title: intl.formatMessage({
@@ -154,12 +155,14 @@ export default (props: ButtonsProps) => {
       }),
       width: 300,
       dataIndex: 'name',
+      ellipsis: true,
     },
     {
       title: intl.formatMessage({
         id: 'page.system.menu.describe',
         defaultMessage: '说明',
       }),
+      ellipsis: true,
       dataIndex: 'description',
       // render: (_, row) => () => {
       //   console.log(row)

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

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