Przeglądaj źródła

feat: 表格排序

outaozhen 5 lat temu
rodzic
commit
57cd37d553

+ 1 - 0
src/pages/Customer/Company/index.jsx

@@ -141,6 +141,7 @@ const Company = props => {
       key: 'companyName',
       width: 150,
       search: false,
+      sorter: (a, b) => a.companyName.localeCompare(b.companyName),
       render: (companyName, record) => (
         <span
           onClick={() => showDrawer(record.id)}

+ 2 - 0
src/pages/Customer/Contact/index.jsx

@@ -133,6 +133,7 @@ const Contact = props => {
           {clientName}
         </span>
       ),
+      sorter: (a, b) => a.clientName.localeCompare(b.clientName),
       search: false
     },
     {
@@ -142,6 +143,7 @@ const Contact = props => {
       width: 150,
       ellipsis: true,
       render: companyName => <a>{companyName}</a>,
+      sorter: (a, b) => a.companyName.localeCompare(b.companyName),
       search: false
     },
     {