Sfoglia il codice sorgente

feat: 调整表格、表单列宽

lanjianrong 3 anni fa
parent
commit
1b94d3fc60

+ 13 - 0
src/global.less

@@ -111,6 +111,7 @@ ol {
   color: rgba(0, 0, 0, 0.45) !important;
   cursor: not-allowed;
 }
+<<<<<<< HEAD
 .ant-pro-page-container-warp {
   background-color: transparent !important;
 }
@@ -151,3 +152,15 @@ ol {
 //   background-color: #f5f7fa;
 //   border-radius: 10px 10px 10px 10px;
 // }
+=======
+
+.fr-item-wrapper .ant-input {
+  width: 300px !important;
+}
+.fr-item-wrapper .ant-select-selector {
+  width: 300px !important;
+}
+.fr-item-wrapper .ant-input-affix-wrapper {
+  width: 300px !important;
+}
+>>>>>>> ba83460... feat: 调整表格、表单列宽

+ 16 - 2
src/pages/Institutions/Company/Detail/components/Staff.tsx

@@ -61,18 +61,24 @@ const Staff: React.FC<ListProps> = ({
   const columns = [
     {
       dataIndex: 'account',
-      title: '帐号'
+      title: '帐号',
+      width: 100
     },
     {
       dataIndex: 'name',
       title: '姓名',
+<<<<<<< HEAD
       renderText: (text, record) => `${text}${record.ID === managerID ? ' (管理员) ' : null}`
+=======
+      width: 70
+>>>>>>> ba83460... feat: 调整表格、表单列宽
     },
     {
       dataIndex: 'enable',
       key: 'enable',
       title: '状态',
       filters: true,
+      width: 40,
       filterMultiple: false,
       valueEnum: {
         true: { text: '启用', status: 'Success' },
@@ -83,6 +89,7 @@ const Staff: React.FC<ListProps> = ({
       dataIndex: 'gender',
       key: 'gender',
       title: '性别',
+      width: 40,
       render: (_, { gender }) => {
         return <span>{genderEum[gender]}</span>
       }
@@ -91,29 +98,34 @@ const Staff: React.FC<ListProps> = ({
       dataIndex: 'organizationalStructureID',
       key: 'organizationalStructureID',
       title: '组织架构',
+      width: 130,
       renderText: (_, record) => record.organizationalStructure?.name
     },
     {
       dataIndex: 'institutionID',
       key: 'institutionID',
       title: '所属企事业单位',
+      width: 270,
       renderText: (_, record) => record.institution.name
     },
     {
       dataIndex: 'phone',
       key: 'phone',
-      title: '手机'
+      title: '手机',
+      width: 100
     },
     {
       dataIndex: 'createdTime',
       key: 'createdTime',
       title: '创建时间',
+      width: 90,
       renderText: text => dayjs(text).format('YYYY-MM-DD')
     },
     {
       dataIndex: 'created',
       key: 'created',
       title: '创建者',
+      width: 100,
       renderText: (_, record) => record?.created?.name
     },
     {
@@ -121,6 +133,7 @@ const Staff: React.FC<ListProps> = ({
       key: 'accountType',
       title: '账号类型',
       filters: true,
+      width: 80,
       filterMultiple: false,
       valueEnum: accountTypeList.reduce((prev, curr) => {
         const items = { ...prev }
@@ -133,6 +146,7 @@ const Staff: React.FC<ListProps> = ({
     {
       title: '操作',
       dataIndex: 'operation',
+      width: 45,
       render: (_, record) => (
         <div className="divide-x divide-bg-gray-400 flex flex-row">
           <div

+ 4 - 6
src/pages/Institutions/Company/List/components/CompanyDrawer.tsx

@@ -79,13 +79,11 @@ const CompanyDrawer: React.FC<CompanyModalProps> = ({
     // })
   }
   return (
-    <div>
-      <div className="text-xl mb-6">
-        {type === ModalType.ADD ? '新增企事业单位' : null}
-        {type === ModalType.UPDATE ? '编辑企事业单位' : null}
+    <div className="mt-6">
+      <div className="max-w-964px">
+        {schema && <FormRender form={form} schema={schema} onFinish={onFinish} onMount={onMount} />}
       </div>
-      {schema && <FormRender form={form} schema={schema} onFinish={onFinish} onMount={onMount} />}
-      <div className="ml-120px">
+      <div className="ml-137px">
         <Button type="primary" onClick={form.submit}>
           提交
         </Button>

+ 13 - 3
src/pages/Institutions/Company/List/index.tsx

@@ -73,6 +73,7 @@ const CompanyList: React.FC<ListProps> = ({ base, dispatch, pTypeList }) => {
     {
       dataIndex: 'name',
       title: '企事业单位名称',
+      width: 286,
       render: (name, record) => (
         <span
           onClick={() =>
@@ -92,16 +93,22 @@ const CompanyList: React.FC<ListProps> = ({ base, dispatch, pTypeList }) => {
     },
     {
       dataIndex: 'acronym',
-      title: '企事业单位简称'
+      title: '企事业单位简称',
+      width: 286
     },
     {
       dataIndex: 'institutionAcountTotal',
       title: '人员账号',
+<<<<<<< HEAD
       renderText: (text, record) => `${text}/${record.memberTotal}`
+=======
+      width: 96
+>>>>>>> ba83460... feat: 调整表格、表单列宽
     },
     {
       dataIndex: 'createdTime',
       title: '创建时间',
+      width: 106,
       renderText: text => dayjs(text).format('YYYY-MM-DD')
     },
     // {
@@ -120,15 +127,17 @@ const CompanyList: React.FC<ListProps> = ({ base, dispatch, pTypeList }) => {
     // },
     {
       dataIndex: 'created',
-      title: '创建人'
+      title: '创建人',
+      width: 116
     },
     {
       title: '操作',
       dataIndex: 'operation',
+      width: 61,
       render: (_, record) => (
         <div className="divide-x divide-bg-gray-400 flex flex-row">
           <div
-            className="pr-2 text-primary cursor-pointer hover:text-hex-967bbd"
+            className="text-primary cursor-pointer hover:text-hex-967bbd"
             onClick={() => {
               setState({
                 ...state,
@@ -191,6 +200,7 @@ const CompanyList: React.FC<ListProps> = ({ base, dispatch, pTypeList }) => {
         search={false}
       />
       <AnimateContent
+        title={state.currentModalType === ModalType.ADD ? '新增企事业单位' : '编辑企事业单位'}
         visible={state.visible}
         onVisibleChange={visible => setState({ ...state, visible })}
       >

+ 2 - 1
src/pages/Institutions/Staff/components/StaffDetail.tsx

@@ -243,6 +243,7 @@ const StaffDrawer: React.FC<StaffModalProps> = ({
     <div className="mt-6">
       {schema && (
         <FormRender
+          className="max-w-402px"
           form={form}
           schema={schema}
           onFinish={onFinish}
@@ -252,7 +253,7 @@ const StaffDrawer: React.FC<StaffModalProps> = ({
           watch={watch}
         />
       )}
-      <div className="ml-120px">
+      <div className="ml-137px">
         {type === ModalType.UPDATE ? (
           <ModalForm
             formRef={formRef}

+ 11 - 2
src/pages/Institutions/Staff/index.tsx

@@ -60,6 +60,7 @@ const CompanyList: React.FC<ListProps> = ({ schema, dispatch, accountTypeList })
       dataIndex: 'account',
       key: 'account',
       title: '账号',
+      width: 116,
       render: (name, record) => (
         <div
           className="text-primary cursor-pointer hover:text-hex-967bbd"
@@ -84,12 +85,14 @@ const CompanyList: React.FC<ListProps> = ({ schema, dispatch, accountTypeList })
     {
       dataIndex: 'name',
       key: 'name',
-      title: '名称'
+      title: '名称',
+      width: 86
     },
     {
       dataIndex: 'enable',
       key: 'enable',
       title: '状态',
+      width: 56,
       filters: true,
       filterMultiple: false,
       valueEnum: {
@@ -101,6 +104,7 @@ const CompanyList: React.FC<ListProps> = ({ schema, dispatch, accountTypeList })
       dataIndex: 'gender',
       key: 'gender',
       title: '性别',
+      width: 56,
       render: (_, { gender }) => {
         return <span>{genderEum[gender]}</span>
       }
@@ -109,18 +113,20 @@ const CompanyList: React.FC<ListProps> = ({ schema, dispatch, accountTypeList })
       dataIndex: 'organizationalStructureID',
       key: 'organizationalStructureID',
       title: '组织架构',
+      width: 146,
       renderText: (_, record) => record.organizationalStructure?.name
     },
     {
       dataIndex: 'institutionID',
       key: 'institutionID',
       title: '所属企事业单位',
-      width: 120,
+      width: 286,
       renderText: (_, record) => record.institution.name
     },
     {
       dataIndex: 'createdTime',
       key: 'createdTime',
+      width: 106,
       title: '创建时间',
       renderText: text => dayjs(text).format('YYYY-MM-DD')
     },
@@ -128,12 +134,14 @@ const CompanyList: React.FC<ListProps> = ({ schema, dispatch, accountTypeList })
       dataIndex: 'created',
       key: 'created',
       title: '创建者',
+      width: 116,
       renderText: (_, record) => record?.created?.name
     },
     {
       dataIndex: 'accountType',
       key: 'accountType',
       title: '账号类型',
+      width: 96,
       filters: true,
       filterMultiple: false,
       valueEnum: accountTypeList.reduce((prev, curr) => {
@@ -147,6 +155,7 @@ const CompanyList: React.FC<ListProps> = ({ schema, dispatch, accountTypeList })
     {
       title: '操作',
       dataIndex: 'operation',
+      width: 61,
       render: (_, record) => (
         <div className="divide-x divide-bg-gray-400 flex flex-row">
           <div

+ 7 - 2
src/pages/Project/Created/index.tsx

@@ -48,25 +48,30 @@ const Created = () => {
   const columns: ProFormColumnsType<AccountListItem>[] = [
     {
       dataIndex: 'account',
-      title: '账号'
+      title: '账号',
+      width: 116
     },
     {
       dataIndex: 'name',
-      title: '名称'
+      title: '名称',
+      width: 86
     },
     {
       dataIndex: 'institutionID',
       title: '企事业单位',
+      width: 286,
       renderText: (_, record) => record?.institution?.name
     },
     {
       dataIndex: 'organizationalStructureID',
       title: '组织架构',
+      width: 146,
       renderText: (_, record) => record?.organizationalStructure?.name
     },
     {
       dataIndex: 'opreate',
       title: '操作',
+      width: 61,
       render: (_, record) => (
         <div
           className="text-hex-fd3995 cursor-pointer hover:text-hex-e7026e"

+ 6 - 0
src/pages/Project/Management/List/index.tsx

@@ -66,6 +66,7 @@ const List: React.FC<ListProps> = ({ schema, dispatch, pTypeList }) => {
     {
       dataIndex: 'name',
       title: '项目名称',
+      width: 286,
       render: (text, record) => (
         <span
           className="text-primary cursor-pointer hover:text-hex-967bbd"
@@ -86,11 +87,13 @@ const List: React.FC<ListProps> = ({ schema, dispatch, pTypeList }) => {
     {
       dataIndex: 'createdTime',
       title: '创建时间',
+      width: 116,
       renderText: text => dayjs(text).format('YYYY-MM-DD')
     },
     {
       dataIndex: 'projectTypeID',
       title: '项目类型',
+      width: 126,
       filters: true,
       filterMultiple: false,
       valueEnum: pTypeList.reduce((prev, curr) => {
@@ -105,6 +108,7 @@ const List: React.FC<ListProps> = ({ schema, dispatch, pTypeList }) => {
       dataIndex: 'createdID',
       key: 'createdID',
       title: '创建人',
+      width: 326,
       renderText: (_, record) =>
         record?.created?.ID
           ? `${record?.created?.name}(${record?.created?.institution?.name})`
@@ -114,6 +118,7 @@ const List: React.FC<ListProps> = ({ schema, dispatch, pTypeList }) => {
       dataIndex: 'reportAccount',
       key: 'reportAccount',
       title: '编辑者',
+      width: 256,
       renderText: (_, record) => (
         <div>
           {record.reportAccount?.map(item => (
@@ -131,6 +136,7 @@ const List: React.FC<ListProps> = ({ schema, dispatch, pTypeList }) => {
     {
       title: '操作',
       dataIndex: 'operation',
+      width: 91,
       render: (_, record) => (
         <div className="divide-x divide-bg-gray-400 flex flex-row">
           <div

+ 6 - 0
src/pages/Schema/Base/index.tsx

@@ -144,7 +144,13 @@ const Index: React.FC<BaseProps> = ({ base, pTypeList, dispatch }) => {
               onClick={() => gotoDetail(state.activeKey)}
               className="w-14px h-14px rounded-1/2 hover:bg-dark-50 hover:cursor-pointer"></div>
           </div>
+<<<<<<< HEAD
           <div className="max-w-800px">{renderForm()}</div>
+=======
+          <div className="max-w-874px">
+            {currentSchema && <FormRender form={form} schema={currentSchema?.schema} />}
+          </div>
+>>>>>>> ba83460... feat: 调整表格、表单列宽
         </div>
       </div>
     </PageContainer>

+ 3 - 3
src/pages/user/Login/index.tsx

@@ -2,7 +2,7 @@ import { LockOutlined, UserOutlined } from '@ant-design/icons'
 import { Alert, message } from 'antd'
 import React, { useState } from 'react'
 import ProForm, { ProFormCheckbox, ProFormText } from '@ant-design/pro-form'
-import { useIntl, Link, history, FormattedMessage, SelectLang, useModel, useRequest } from 'umi'
+import { useIntl, history, FormattedMessage, SelectLang, useModel, useRequest } from 'umi'
 import { login } from '@/services/api/login'
 import { queryCurrentUser } from '@/services/api/login'
 import consts from '@/utils/consts'
@@ -118,10 +118,10 @@ const Login: React.FC = () => {
         <div className={styles.content}>
           <div className={styles.top}>
             <div className={styles.header}>
-              <Link to="/" className="flex justify-center">
+              <div className="flex justify-center">
                 <img alt="logo" className={styles.logo} src="/logo.png" />
                 <span className={styles.title}>珠海市政府投资项目经济技术指标库</span>
-              </Link>
+              </div>
             </div>
             <div className={styles.desc}>
               {intl.formatMessage({ id: 'pages.layouts.userLayout.title' })}