Bläddra i källkod

fix: 项目详情预览抽屉打开模式错误优化AnimateContent组件内容区样式

lanjianrong 3 år sedan
förälder
incheckning
beb2a8c5d8

+ 3 - 0
src/components/AnimateContent/index.less

@@ -6,4 +6,7 @@
   :global(.ant-page-header) {
     padding: 0;
   }
+  :global(.ant-drawer-body) {
+    padding: 0 24px 24px;
+  }
 }

+ 7 - 2
src/pages/Project/Management/components/Detail.tsx

@@ -10,7 +10,7 @@ import type { ConnectProps } from 'umi'
 import type { ProjectModelState } from '../../model'
 import ProForm from '@ant-design/pro-form'
 import TreeNodeSelect from './TreeNodeSelect'
-import { ModalType } from '@/utils/enum'
+import { ModalType } from './ProjectModal'
 import consts from '@/utils/consts'
 
 type ProjectModalProps = ConnectProps & {
@@ -33,6 +33,8 @@ const DetailModal: React.FC<ProjectModalProps> = ({
   pTypeList,
   reload
 }) => {
+  console.log(type)
+
   const form = useForm()
   const ref = useRef<FormInstance>(null)
   const { TabPane } = Tabs
@@ -129,6 +131,8 @@ const DetailModal: React.FC<ProjectModalProps> = ({
       return false
     }
   }
+  console.log(type === ModalType.PREVIEW)
+
   return (
     <Tabs onChange={onChange}>
       <TabPane tab="项目信息" key="1">
@@ -145,7 +149,8 @@ const DetailModal: React.FC<ProjectModalProps> = ({
         <ProForm
           formRef={ref}
           submitter={{ resetButtonProps: { style: { display: 'none' } } }}
-          onFinish={onFinish}>
+          onFinish={onFinish}
+        >
           <Form.Item label="指定人员" name="accountID">
             <TreeNodeSelect />
             {/* <TreeSelect

+ 11 - 5
src/pages/Project/Management/index.tsx

@@ -72,7 +72,8 @@ const List: React.FC<ListProps> = ({ schema, dispatch, pTypeList }) => {
                 dataID: record.ID
               }
             })
-          }}>
+          }}
+        >
           {text}
         </span>
       )
@@ -130,14 +131,16 @@ const List: React.FC<ListProps> = ({ schema, dispatch, pTypeList }) => {
                   dataID: record.ID
                 }
               })
-            }}>
+            }}
+          >
             编辑
           </div>
           <Popconfirm
             title="确认删除吗?"
             okText="确认"
             cancelText="取消"
-            onConfirm={() => tryDelProject({ ID: record.ID })}>
+            onConfirm={() => tryDelProject({ ID: record.ID })}
+          >
             <div className="pl-2 text-hex-fd3995 cursor-pointer hover:text-hex-e7026e">
               <DeleteOutlined />
             </div>
@@ -178,7 +181,8 @@ const List: React.FC<ListProps> = ({ schema, dispatch, pTypeList }) => {
               type="primary"
               onClick={() =>
                 setState({ ...state, visible: true, currentModalType: ModalType.ADD, title: '' })
-              }>
+              }
+            >
               新建项目
             </Button>
           ]
@@ -195,13 +199,15 @@ const List: React.FC<ListProps> = ({ schema, dispatch, pTypeList }) => {
           </>
         }
         visible={state.visible}
-        onVisibleChange={onAnimateChange}>
+        onVisibleChange={onAnimateChange}
+      >
         {state.currentModalType === ModalType.PREVIEW ? (
           <Detail
             defaultFormData={state.defaultFormData}
             pTypeList={pTypeList}
             reload={() => tRef.current?.reload()}
             onVisibleChange={onAnimateChange}
+            type={state.currentModalType}
           />
         ) : (
           <ProjectModal