lanjianrong 3 éve
szülő
commit
39346cb760

+ 3 - 3
package.json

@@ -51,15 +51,15 @@
     "@ant-design/icons": "^4.5.0",
     "@ant-design/pro-descriptions": "^1.6.8",
     "@ant-design/pro-form": "^1.18.3",
-    "@ant-design/pro-layout": "6.32.1",
+    "@ant-design/pro-layout": "6.32.2",
     "@ant-design/pro-table": "^2.30.8",
     "@umijs/route-utils": "^1.0.36",
     "ahooks": "^3.0.0",
-    "antd": "4.18.1",
+    "antd": "^4.18.2",
     "classnames": "^2.2.6",
     "dayjs": "^1.10.7",
     "form-render": "1.7.3",
-    "fr-generator": "^2.6.1",
+    "fr-generator": "^2.7.3",
     "lodash": "^4.17.11",
     "moment": "^2.25.3",
     "omit.js": "^2.0.2",

+ 20 - 18
src/pages/Project/Management/components/ProjectModal.tsx

@@ -64,26 +64,28 @@ const ProjectModal: React.FC<ProjectModalProps> = ({
   })
 
   const onMount = async () => {
-    const { code = -1, data = {} } = await getProject({ ID: defaultFormData.dataID })
-    if (code === consts.RET_CODE.SUCCESS) {
-      const currentFormData = { ...data }
-      const keys = Object.keys(currentFormData)
-      keys.forEach(key => {
-        if (currentFormData[key] instanceof Object) {
-          const targetMap = currentFormData[key]
-          delete currentFormData[key]
-          currentFormData[`${key}ID`] = targetMap.ID
-        }
-      })
-      form.setValues(type === ModalType.ADD ? {} : { ...currentFormData })
-      delay(80).then(() => {
-        // console.log(pTypeList)
+    if (defaultFormData?.dataID) {
+      const { code = -1, data = {} } = await getProject({ ID: defaultFormData.dataID })
+      if (code === consts.RET_CODE.SUCCESS) {
+        const currentFormData = { ...data }
+        const keys = Object.keys(currentFormData)
+        keys.forEach(key => {
+          if (currentFormData[key] instanceof Object) {
+            const targetMap = currentFormData[key]
+            delete currentFormData[key]
+            currentFormData[`${key}ID`] = targetMap.ID
+          }
+        })
+        form.setValues(type === ModalType.ADD ? {} : { ...currentFormData })
+        delay(80).then(() => {
+          // console.log(pTypeList)
 
-        form.setSchemaByPath('projectTypeID', {
-          enum: pTypeList.map(item => item.value),
-          enumNames: pTypeList.map(item => item.label)
+          form.setSchemaByPath('projectTypeID', {
+            enum: pTypeList.map(item => item.value),
+            enumNames: pTypeList.map(item => item.label)
+          })
         })
-      })
+      }
     }
   }
 

+ 5 - 5
src/pages/Schema/Base/index.tsx

@@ -2,7 +2,6 @@ import { PageContainer } from '@ant-design/pro-layout'
 import LeftMenu from './components/LeftMenu'
 import { useState, useEffect } from 'react'
 import FormRender, { useForm } from 'form-render'
-import { Button } from 'antd'
 import { history, connect } from 'umi'
 import type { ConnectProps } from 'umi'
 import type { SchemaBaseModelState } from './model'
@@ -58,10 +57,11 @@ const Index: React.FC<BaseProps> = ({ base, dispatch }) => {
           onChange={key => setState({ ...state, activeKey: key })}
         />
         <div className="w-6/7 ml-8 bg-white p-4 shadow-card relative ">
-          <div className="text-right mb-4">
-            <Button type="primary" onClick={() => gotoDetail(state.activeKey, currentSchema?.ID)}>
-              编辑
-            </Button>
+          <div className="flex flex-row-reverse mb-4 w-full">
+            <div
+              onClick={() => gotoDetail(state.activeKey, currentSchema?.ID)}
+              className="w-14px h-14px rounded-1/2 hover:bg-dark-50 hover:cursor-pointer"
+            ></div>
           </div>
           <div>{currentSchema && <FormRender form={form} schema={currentSchema?.schema} />}</div>
         </div>

+ 7 - 5
src/pages/user/Login/index.tsx

@@ -132,6 +132,7 @@ const Login: React.FC = () => {
               initialValues={{
                 autoLogin: true
               }}
+              isKeyPressSubmit
               submitter={{
                 searchConfig: {
                   submitText: intl.formatMessage({
@@ -148,9 +149,8 @@ const Login: React.FC = () => {
                   }
                 }
               }}
-              onFinish={async values => {
-                handleSubmit(values as API.LoginParams)
-              }}>
+              onFinish={values => handleSubmit(values as API.LoginParams)}
+            >
               {/* <Tabs activeKey={type} onChange={setType}>
                 <Tabs.TabPane
                   key="account"
@@ -215,14 +215,16 @@ const Login: React.FC = () => {
               <div
                 style={{
                   marginBottom: 24
-                }}>
+                }}
+              >
                 <ProFormCheckbox noStyle name="autoLogin">
                   <FormattedMessage id="pages.login.rememberMe" defaultMessage="自动登录" />
                 </ProFormCheckbox>
                 <a
                   style={{
                     float: 'right'
-                  }}>
+                  }}
+                >
                   <FormattedMessage id="pages.login.forgotPassword" defaultMessage="忘记密码" />
                 </a>
               </div>