Bläddra i källkod

fix: 替换单位详情客户的table

outaozhen 4 år sedan
förälder
incheckning
e36fdb4edb

+ 1 - 0
package.json

@@ -53,6 +53,7 @@
     "@ant-design/pro-form": "1.42.1",
     "@ant-design/pro-layout": "6.19.3",
     "@ant-design/pro-table": "2.43.4",
+    "@arco-design/web-react": "^2.24.0",
     "@icon-park/react": "^1.3.3",
     "@types/react-window": "^1.8.5",
     "@umijs/route-utils": "^1.0.33",

+ 18 - 7
src/pages/Customer/Company/components/CompanyDetail/TabList.jsx

@@ -2,6 +2,9 @@ import ContactDetail from '@/pages/Customer/Client/components/ClientDetail'
 import LocksDetail from '@/pages/Product/Lock/LockStore/components/LocksDetail'
 import React, { useRef, useState } from 'react'
 import { Tabs, message, Dropdown, Menu, Typography } from 'antd'
+import { Table } from '@arco-design/web-react'
+import '@arco-design/web-react/dist/css/arco.css'
+import styles from './index.less'
 import AddContact from '@/pages/Customer/Client/components/AddClient'
 import { apiAddClient, apiAddCustomerService, updateClient } from '@/services/customer'
 import { formatValues } from '@/components/LazyCascader'
@@ -117,7 +120,7 @@ const CompanyTabList = ({
     {
       title: '优先级',
       dataIndex: 'priority',
-      width: '17%',
+      width: '15%',
       sorter: (a, b) => a.priority - b.priority,
       render: (text, record) => (
         <Dropdown
@@ -140,7 +143,7 @@ const CompanyTabList = ({
       title: '所有部门',
       dataIndex: 'department',
       onFilter: true,
-      width: '23%',
+      width: '20%',
       filters: Array.from(
         new Set(client.client?.map(item => item.department)).map(item => ({
           text: item,
@@ -169,13 +172,13 @@ const CompanyTabList = ({
     {
       title: '手机',
       dataIndex: 'telephone',
-      width: '20%',
+      // width: '20%',
       ellipsis: true
     },
     {
       title: 'QQ',
       dataIndex: 'qq',
-      width: '20%',
+      // width: '20%',
       ellipsis: true
     }
   ]
@@ -348,8 +351,16 @@ const CompanyTabList = ({
       <div className="pl-15px">
         <Tabs>
           <TabPane tab={<span>客户{renderBadge(client.total, true)}</span>} key="1">
-            <div className="sheet-right-panel" ref={tRef}>
-              <ProTable
+            <div className={['sheet-right-panel', styles.tableCont].join('')} ref={tRef}>
+              <Table
+                virtualized
+                scroll={{ y: 500 }}
+                border
+                columns={columns}
+                data={client.client}
+                pagination={false}
+              />
+              {/* <ProTable
                 size="small"
                 columns={columns}
                 search={false}
@@ -358,7 +369,7 @@ const CompanyTabList = ({
                 rowKey={record => record.id}
                 pagination={false}
                 scroll={{ y: clientHeight }}
-              />
+              /> */}
               {/* <VirtualTable
                 size="small"
                 columns={columns}

+ 8 - 0
src/pages/Customer/Company/components/CompanyDetail/index.less

@@ -0,0 +1,8 @@
+.tableCont {
+  :global(.arco-table-th-item) {
+    padding: 0;
+  }
+  :global(.arco-table-col-has-sorter .arco-table-cell-with-sorter) {
+    padding: 8px 8px;
+  }
+}