Explorar el Código

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

outaozhen hace 5 años
padre
commit
bb52466a6b
Se han modificado 2 ficheros con 7 adiciones y 7 borrados
  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',
       dataIndex: 'phone',
       key: 'phone',
       key: 'phone',
       width: 65,
       width: 65,
-      sorter: true
+      sorter: (a, b) => a.phone.localeCompare(b.phone)
     },
     },
     {
     {
       title: '手机',
       title: '手机',
       dataIndex: 'telephone',
       dataIndex: 'telephone',
       key: 'telephone',
       key: 'telephone',
       width: 75,
       width: 75,
-      sorter: true,
+      sorter: (a, b) => a.telephone.localeCompare(b.telephone),
       search: false
       search: false
     },
     },
     {
     {
@@ -208,7 +208,7 @@ const Client = props => {
       dataIndex: 'qq',
       dataIndex: 'qq',
       key: 'qq',
       key: 'qq',
       width: 75,
       width: 75,
-      sorter: true,
+      sorter: (a, b) => a.qq.localeCompare(b.qq),
       search: false
       search: false
     },
     },
     {
     {
@@ -216,7 +216,7 @@ const Client = props => {
       dataIndex: 'email',
       dataIndex: 'email',
       key: 'email',
       key: 'email',
       width: 75,
       width: 75,
-      sorter: true,
+      sorter: (a, b) => a.email.localeCompare(b.email),
       search: false
       search: false
     },
     },
     {
     {
@@ -321,7 +321,7 @@ const Client = props => {
       key: 'address',
       key: 'address',
       ellipsis: true,
       ellipsis: true,
       width: 150,
       width: 150,
-      sorter: true,
+      sorter: (a, b) => a.address.localeCompare(b.address),
       search: false
       search: false
     },
     },
     {
     {

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

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