Browse Source

feat: 表格表头居中

outaozhen 3 years ago
parent
commit
7a74f3bce5

+ 12 - 6
src/pages/Institutions/Company/Detail/components/Organization.tsx

@@ -100,7 +100,8 @@ const Organization: React.FC<OrganizationProps> = ({ dataID, structureType }) =>
           {record.isStart === false ? (
             <div
               className="px-2 text-primary cursor-pointer hover:text-hex-967bbd"
-              onClick={() => tryMoveOrganization({ ID: record.ID, operation: 'up' })}>
+              onClick={() => tryMoveOrganization({ ID: record.ID, operation: 'up' })}
+            >
               <Tooltip placement="top" title="上移">
                 <ArrowUpOutlined />
               </Tooltip>
@@ -109,7 +110,8 @@ const Organization: React.FC<OrganizationProps> = ({ dataID, structureType }) =>
           {record.isEnd === false ? (
             <div
               className="px-2 text-primary cursor-pointer hover:text-hex-967bbd"
-              onClick={() => tryMoveOrganization({ ID: record.ID, operation: 'down' })}>
+              onClick={() => tryMoveOrganization({ ID: record.ID, operation: 'down' })}
+            >
               <Tooltip placement="top" title="下移">
                 <ArrowDownOutlined />
               </Tooltip>
@@ -125,7 +127,8 @@ const Organization: React.FC<OrganizationProps> = ({ dataID, structureType }) =>
                   defaultFormData: record,
                   currentModalType: ModalTypeEnum.MOVE
                 })
-              }}>
+              }}
+            >
               <Tooltip placement="top" title="移动">
                 <SwapOutlined />
               </Tooltip>
@@ -145,7 +148,8 @@ const Organization: React.FC<OrganizationProps> = ({ dataID, structureType }) =>
                 },
                 currentModalType: ModalTypeEnum.ADDITEM
               })
-            }}>
+            }}
+          >
             <Tooltip placement="top" title="添加子项">
               <PlusSquareOutlined />
             </Tooltip>
@@ -159,7 +163,8 @@ const Organization: React.FC<OrganizationProps> = ({ dataID, structureType }) =>
                 defaultFormData: record,
                 currentModalType: ModalTypeEnum.UPDATE
               })
-            }}>
+            }}
+          >
             <Tooltip placement="top" title="重命名">
               <EditOutlined />
             </Tooltip>
@@ -230,7 +235,8 @@ const Organization: React.FC<OrganizationProps> = ({ dataID, structureType }) =>
                     parentID: state.parentID
                   }
                 })
-              }>
+              }
+            >
               添加组织
             </Button>
           ]

+ 8 - 6
src/pages/Institutions/Company/List/index.tsx

@@ -86,7 +86,8 @@ const CompanyList: React.FC<ListProps> = ({ base, dispatch, pTypeList }) => {
               managerID: record.manager.ID
             })
           }
-          className="text-primary cursor-pointer">
+          className="text-primary cursor-pointer"
+        >
           {name}
         </span>
       )
@@ -148,7 +149,8 @@ const CompanyList: React.FC<ListProps> = ({ base, dispatch, pTypeList }) => {
                 currentModalType: ModalType.UPDATE,
                 defaultFormData: record
               })
-            }}>
+            }}
+          >
             编辑
           </div>
           {/* <Popconfirm
@@ -193,9 +195,8 @@ const CompanyList: React.FC<ListProps> = ({ base, dispatch, pTypeList }) => {
           actions: [
             <Button
               type="primary"
-              onClick={() =>
-                setState({ ...state, visible: true, currentModalType: ModalType.ADD })
-              }>
+              onClick={() => setState({ ...state, visible: true, currentModalType: ModalType.ADD })}
+            >
               新建企事业单位
             </Button>
           ]
@@ -205,7 +206,8 @@ const CompanyList: React.FC<ListProps> = ({ base, dispatch, pTypeList }) => {
       <AnimateContent
         title={state.currentModalType === ModalType.ADD ? '新增企事业单位' : '编辑企事业单位'}
         visible={state.visible}
-        onVisibleChange={visible => setState({ ...state, visible })}>
+        onVisibleChange={visible => setState({ ...state, visible })}
+      >
         <CompanyDrawer
           type={state.currentModalType}
           defaultFormData={state.defaultFormData}

+ 8 - 4
src/pages/Project/Created/index.tsx

@@ -87,7 +87,8 @@ const Created = () => {
               modalType: CreatedModalType.DEL,
               modalVisible: true
             })
-          }>
+          }
+        >
           <DeleteOutlined />
         </div>
       )
@@ -129,7 +130,8 @@ const Created = () => {
               type="primary"
               onClick={() =>
                 setState({ ...state, modalVisible: true, modalType: CreatedModalType.ADD })
-              }>
+              }
+            >
               添加创建人
             </Button>
           ]
@@ -158,14 +160,16 @@ const Created = () => {
         }}
         isKeyPressSubmit
         visible={state.modalVisible}
-        onVisibleChange={visible => setState({ ...state, modalVisible: visible })}>
+        onVisibleChange={visible => setState({ ...state, modalVisible: visible })}
+      >
         {state.modalType === CreatedModalType.ADD ? (
           <>
             {/* <p className="mb-4">创建人可在前台创建项目、上传项目数据、编制项目等</p> */}
             <Form.Item
               name="ID"
               label="创建人可在前台创建项目、上传项目数据、编制项目等"
-              rules={[{ required: true, message: '请选择创建人' }]}>
+              rules={[{ required: true, message: '请选择创建人' }]}
+            >
               <TreeNodeSelect params={{ isCreated: 0 }} />
             </Form.Item>
             {/* <ProFormSelect