Explorar el Código

feat: add projectLimit field,del isCreated field

lanjianrong hace 3 años
padre
commit
7db5f355b4
Se han modificado 3 ficheros con 15 adiciones y 37 borrados
  1. 0 5
      config/routes.ts
  2. 0 18
      src/pages/Institutions/Staff/components/StaffDetail.tsx
  3. 15 14
      src/utils/schema.ts

+ 0 - 5
config/routes.ts

@@ -63,11 +63,6 @@
         path: '/project/verification',
         name: 'verification',
         component: './Project/Verification'
-      },
-      {
-        path: '/project/created',
-        name: 'created',
-        component: './Project/Created'
       }
     ]
   },

+ 0 - 18
src/pages/Institutions/Staff/components/StaffDetail.tsx

@@ -123,24 +123,6 @@ const StaffDrawer: React.FC<StaffModalProps> = ({
           onFieldMount('account', field => {
             type !== ModalType.ADD && (field.disabled = true)
           })
-          onFieldReact('isCreated', field => {
-            if (defaultFormData.ID) {
-              field.disabled = true
-              field.value &&
-                field.setDecoratorProps({
-                  addonAfter: (
-                    <div>
-                      <span className="text-red-500 mr-2">需要移除请进入</span>
-                      <Link to="/project/created" className="text-primary">
-                        项目创建人
-                      </Link>
-                    </div>
-                  )
-                })
-            } else {
-              return generateFieldIsCreated(field)
-            }
-          })
           onFieldMount('institutionID', field => {
             field.dataSource = [{ label: institution?.name, value: institution?.ID }]
           })

+ 15 - 14
src/utils/schema.ts

@@ -60,13 +60,14 @@ export const staffSchema = {
       'x-component': 'Switch',
       'x-index': 0
     },
-    isCreated: {
-      type: 'boolean',
-      title: '项目创建人',
+    projectLimit: {
+      type: 'number',
       required: true,
+      title: '创建数量',
+      default: 3,
       'x-decorator': 'FormItem',
-      'x-component': 'Switch',
-      'x-index': 1
+      'x-component': 'NumberPicker',
+      'x-index': 2
     },
     institutionID: {
       type: 'string',
@@ -75,7 +76,7 @@ export const staffSchema = {
       'x-decorator': 'FormItem',
       'x-component': 'Select',
       'x-disabled': true,
-      'x-index': 2
+      'x-index': 3
     },
     account: {
       type: 'string',
@@ -83,7 +84,7 @@ export const staffSchema = {
       required: true,
       'x-decorator': 'FormItem',
       'x-component': 'Input',
-      'x-index': 3
+      'x-index': 4
     },
     name: {
       type: 'string',
@@ -91,7 +92,7 @@ export const staffSchema = {
       required: true,
       'x-decorator': 'FormItem',
       'x-component': 'Input',
-      'x-index': 4
+      'x-index': 5
     },
     password: {
       type: 'string',
@@ -99,7 +100,7 @@ export const staffSchema = {
       required: true,
       'x-decorator': 'FormItem',
       'x-component': 'Input',
-      'x-index': 5
+      'x-index': 6
     },
     roleIDs: {
       type: 'string',
@@ -110,28 +111,28 @@ export const staffSchema = {
       'x-component-props': {
         mode: 'multiple'
       },
-      'x-index': 6
+      'x-index': 7
     },
     organizationalStructureID: {
       type: 'string',
       title: '组织架构',
       'x-decorator': 'FormItem',
       'x-component': 'TreeSelect',
-      'x-index': 7
+      'x-index': 8
     },
     position: {
       type: 'string',
       title: '职位',
       'x-decorator': 'FormItem',
       'x-component': 'Input',
-      'x-index': 8
+      'x-index': 9
     },
     contactMobile: {
       type: 'string',
       title: '联系手机',
       'x-decorator': 'FormItem',
       'x-component': 'Input',
-      'x-index': 9,
+      'x-index': 10,
       'x-validator': [
         {
           pattern: '^(?:(?:\\+|00)86)?1\\d{10}$',
@@ -145,7 +146,7 @@ export const staffSchema = {
       title: '办公电话',
       'x-decorator': 'FormItem',
       'x-component': 'Input',
-      'x-index': 10,
+      'x-index': 11,
       'x-validator': [
         {
           pattern: '^(?:(?:\\d{3}-)?\\d{8}|^(?:\\d{4}-)?\\d{7,8})(?:-\\d+)?$',