Преглед изворни кода

fix: 软件锁表格宽度+仪表盘适应手机调整

outaozhen пре 5 година
родитељ
комит
bfa7abc190
2 измењених фајлова са 67 додато и 31 уклоњено
  1. 17 21
      src/pages/Product/Lock/Lockstore/index.jsx
  2. 50 10
      src/pages/workbench/Dashboard/index.jsx

+ 17 - 21
src/pages/Product/Lock/Lockstore/index.jsx

@@ -188,13 +188,12 @@ const LockStore = ({ prodList = [], dispatch, shouldUpdate }) => {
     {
       title: '锁号',
       dataIndex: 'keyNum',
-      width: 150,
+      width: 90,
       fixed: 'left',
       render: (keyNum, record) => (
         <span
           onClick={() => showDrawer(record.id)}
-          className="text-primary cursor-pointer hover:text-[#967bbd]"
-        >
+          className="text-primary cursor-pointer hover:text-[#967bbd]">
           {keyNum}
         </span>
       )
@@ -211,12 +210,12 @@ const LockStore = ({ prodList = [], dispatch, shouldUpdate }) => {
       dataIndex: 'makeDay',
       valueType: 'date',
       sorter: true,
-      width: 150
+      width: 90
     },
     {
       title: '状态',
       dataIndex: 'status',
-      width: 150,
+      width: 60,
       filters: true,
       onFilter: true,
       valueType: 'select',
@@ -230,7 +229,7 @@ const LockStore = ({ prodList = [], dispatch, shouldUpdate }) => {
       dataIndex: 'stockStatus',
       valueType: 'date',
       key: 'stockStatus',
-      width: 150,
+      width: 60,
       render: (_, { stockStatus }) => {
         return <>{longleStockStatusNum[stockStatus]?.text}</>
       }
@@ -240,14 +239,14 @@ const LockStore = ({ prodList = [], dispatch, shouldUpdate }) => {
       dataIndex: 'stockTime',
       valueType: 'date',
       key: 'stockTime',
-      width: 150
+      width: 90
     },
     {
       title: '销售状态',
       dataIndex: 'sellStatus',
       valueType: 'date',
       key: 'sellStatus',
-      width: 150,
+      width: 60,
       render: (_, { sellStatus }) => {
         return <>{longleSellStatusNum[sellStatus]?.text}</>
       }
@@ -257,14 +256,14 @@ const LockStore = ({ prodList = [], dispatch, shouldUpdate }) => {
       dataIndex: 'sellTime',
       valueType: 'date',
       key: 'sellTime',
-      width: 150
+      width: 90
     },
     {
       title: '维护状态',
       dataIndex: 'preserveStatus',
       valueType: 'date',
       key: 'preserveStatus',
-      width: 150,
+      width: 60,
       render: (_, { preserveStatus }) => {
         return <>{longlePreserveStatusNum[preserveStatus]?.text}</>
       }
@@ -274,17 +273,16 @@ const LockStore = ({ prodList = [], dispatch, shouldUpdate }) => {
       dataIndex: 'preserveTime',
       key: 'preserveTime',
       valueType: 'date',
-      width: 150
+      width: 90
     },
     {
       title: '负责人',
       dataIndex: 'responsible',
-      width: 150,
+      width: 80,
       render: (text, record) => (
         <span
           onClick={() => showDrawerResponsible(record.responsibleId)}
-          className="text-primary cursor-pointer hover:text-[#967bbd]"
-        >
+          className="text-primary cursor-pointer hover:text-[#967bbd]">
           {text}
         </span>
       )
@@ -296,8 +294,7 @@ const LockStore = ({ prodList = [], dispatch, shouldUpdate }) => {
       render: (text, record) => (
         <span
           onClick={() => showCompanyDrawer(record.customerId)}
-          className="text-primary cursor-pointer hover:text-[#967bbd]"
-        >
+          className="text-primary cursor-pointer hover:text-[#967bbd]">
           {text}
         </span>
       )
@@ -309,8 +306,7 @@ const LockStore = ({ prodList = [], dispatch, shouldUpdate }) => {
       render: (text, record) => (
         <span
           onClick={() => showDrawerClient(record.clientId)}
-          className="text-primary cursor-pointer hover:text-[#967bbd]"
-        >
+          className="text-primary cursor-pointer hover:text-[#967bbd]">
           {text}
         </span>
       )
@@ -318,17 +314,17 @@ const LockStore = ({ prodList = [], dispatch, shouldUpdate }) => {
     {
       title: '期限',
       dataIndex: 'allotedTime',
-      width: 160
+      width: 90
     },
     {
       title: '办事处',
       dataIndex: 'category',
-      width: 150
+      width: 90
     },
     {
       title: '部门',
       dataIndex: 'departmentName',
-      width: 150
+      width: 90
     }
   ]
   const columnsStateMap = {

+ 50 - 10
src/pages/workbench/Dashboard/index.jsx

@@ -271,8 +271,13 @@ const Dashboard = () => {
         </span>
       </div>
       <div className="mt-4">
-        <Row gutter={16}>
-          <Col className="gutter-row" span={6}>
+        <Row gutter={24}>
+          <Col
+            className="gutter-row"
+            sm={{ span: 24 }}
+            md={{ span: 24 }}
+            lg={{ span: 6 }}
+            xl={{ span: 6 }}>
             <div className="p-4 bg-white border rounded-2px border-hex-f0f0f0 shadow-card">
               {state.loading ? (
                 <Skeleton active avatar />
@@ -307,7 +312,12 @@ const Dashboard = () => {
               )}
             </div>
           </Col>
-          <Col className="gutter-row" span={6}>
+          <Col
+            className="gutter-row"
+            sm={{ span: 24 }}
+            md={{ span: 24 }}
+            lg={{ span: 6 }}
+            xl={{ span: 6 }}>
             <div className="p-4 bg-white border rounded-2px border-hex-f0f0f0 shadow-card">
               {state.loading ? (
                 <Skeleton active avatar />
@@ -345,7 +355,12 @@ const Dashboard = () => {
               )}
             </div>
           </Col>
-          <Col className="gutter-row" span={6}>
+          <Col
+            className="gutter-row"
+            sm={{ span: 24 }}
+            md={{ span: 24 }}
+            lg={{ span: 6 }}
+            xl={{ span: 6 }}>
             <div className="p-4 bg-white border rounded-2px border-hex-f0f0f0 shadow-card">
               {state.loading ? (
                 <Skeleton active avatar />
@@ -383,7 +398,12 @@ const Dashboard = () => {
               )}
             </div>
           </Col>
-          <Col className="gutter-row" span={6}>
+          <Col
+            className="gutter-row"
+            sm={{ span: 24 }}
+            md={{ span: 24 }}
+            lg={{ span: 6 }}
+            xl={{ span: 6 }}>
             <div className="p-4 bg-white border rounded-2px border-hex-f0f0f0 shadow-card">
               {state.loading ? (
                 <Skeleton active avatar />
@@ -424,8 +444,13 @@ const Dashboard = () => {
         </Row>
       </div>
       <div className="mt-4">
-        <Row gutter={16}>
-          <Col className="gutter-row" span={16}>
+        <Row gutter={24}>
+          <Col
+            className="gutter-row"
+            sm={{ span: 24 }}
+            md={{ span: 24 }}
+            lg={{ span: 16 }}
+            xl={{ span: 16 }}>
             <BusinessChar
               loading={state.loading}
               data={state.businessChar}
@@ -433,7 +458,12 @@ const Dashboard = () => {
             />
           </Col>
 
-          <Col className="gutter-row" span={8}>
+          <Col
+            className="gutter-row"
+            sm={{ span: 24 }}
+            md={{ span: 24 }}
+            lg={{ span: 8 }}
+            xl={{ span: 8 }}>
             <Card
               headStyle={{ padding: '0 12px' }}
               title="数据汇总"
@@ -462,10 +492,20 @@ const Dashboard = () => {
       </div>
       <div className="mt-4">
         <Row gutter={24}>
-          <Col className="gutter-row" span={12}>
+          <Col
+            className="gutter-row"
+            sm={{ span: 24 }}
+            md={{ span: 24 }}
+            lg={{ span: 12 }}
+            xl={{ span: 12 }}>
             <LeaderBoard dataList={state.leaderboard} loading={state.loading} />
           </Col>
-          <Col className="gutter-row" span={12}>
+          <Col
+            className="gutter-row"
+            sm={{ span: 24 }}
+            md={{ span: 24 }}
+            lg={{ span: 12 }}
+            xl={{ span: 12 }}>
             <SoftLeaderboard
               productLeaderBoard={state.productLeaderBoard}
               loading={state.loading}