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

feat: 客户/联系人 数据列 "电话""手机""QQ""邮箱""地址" 增加排序

outaozhen пре 5 година
родитељ
комит
bb52466a6b
2 измењених фајлова са 7 додато и 7 уклоњено
  1. 5 5
      src/pages/Customer/Client/index.jsx
  2. 2 2
      src/pages/Customer/Company/index.jsx

+ 5 - 5
src/pages/Customer/Client/index.jsx

@@ -193,14 +193,14 @@ const Client = props => {
       dataIndex: 'phone',
       key: 'phone',
       width: 65,
-      sorter: true
+      sorter: (a, b) => a.phone.localeCompare(b.phone)
     },
     {
       title: '手机',
       dataIndex: 'telephone',
       key: 'telephone',
       width: 75,
-      sorter: true,
+      sorter: (a, b) => a.telephone.localeCompare(b.telephone),
       search: false
     },
     {
@@ -208,7 +208,7 @@ const Client = props => {
       dataIndex: 'qq',
       key: 'qq',
       width: 75,
-      sorter: true,
+      sorter: (a, b) => a.qq.localeCompare(b.qq),
       search: false
     },
     {
@@ -216,7 +216,7 @@ const Client = props => {
       dataIndex: 'email',
       key: 'email',
       width: 75,
-      sorter: true,
+      sorter: (a, b) => a.email.localeCompare(b.email),
       search: false
     },
     {
@@ -321,7 +321,7 @@ const Client = props => {
       key: 'address',
       ellipsis: true,
       width: 150,
-      sorter: true,
+      sorter: (a, b) => a.address.localeCompare(b.address),
       search: false
     },
     {

+ 2 - 2
src/pages/Customer/Company/index.jsx

@@ -185,7 +185,7 @@ const Company = props => {
       dataIndex: 'phone',
       key: 'phone',
       search: false,
-      sorter: true,
+      sorter: (a, b) => a.phone.localeCompare(b.phone),
       width: 80
     },
     {
@@ -270,7 +270,7 @@ const Company = props => {
       dataIndex: 'address',
       key: 'address',
       search: false,
-      sorter: true,
+      sorter: (a, b) => a.address.localeCompare(b.address),
       width: 150
     },
     {